Utility TypeScript types used across the AgapeToolkit ecosystem.
Represents any constructor function.
type Class = { new (...args: any[]): any };Represents a constructor function that returns an instance of T.
type Class<T> = { new (...args: any[]): T };Extracts only the data properties of T, excluding methods.
type Properties<T> = Pick<T, { [K in keyof T]: T[K] extends Function ? never : K }[keyof T]>;import { Class, Properties } from '@agape/types';
class User {
id!: number;
name!: string;
constructor(params: Properties<User>) {
Object.assign(this, params);
}
}
const model: Class = User;See the full API documentation at agape.dev/api.
This package is part of the Agape Toolkit - a comprehensive collection of TypeScript utilities and libraries for modern web development.