import type { Node } from './Node.ts'; import type { GetSet } from './types.ts'; /** * Enforces that a type is a string. */ type EnforceString = T extends string ? T : never; /** * Represents a class. */ type Constructor = abstract new (...args: any) => any; /** * An attribute of an instance of the provided class. Attributes names be strings. */ type Attr = EnforceString>; /** * A function that is called after a setter is called. */ type AfterFunc = (this: InstanceType) => void; /** * Extracts the type a GetSet returns. The type the setter accepts can be wider, * so it is matched with `any` instead of being inferred from the getter. */ type ExtractGetSet = T extends GetSet ? U : never; /** * Extracts the type of a GetSet class attribute. */ type Value> = ExtractGetSet[U]>; /** * A function that validates a value. */ type ValidatorFunc = (val: T, attr: string) => T; /** * Extracts the "components" (keys) of a GetSet value. The value must be an object. */ type ExtractComponents> = Value extends Record ? EnforceString>[] : never; export declare const Factory: { addGetterSetter>(constructor: T, attr: U, def?: Value, validator?: ValidatorFunc>, after?: AfterFunc): void; addGetter>(constructor: T, attr: U, def?: Value): void; addSetter>(constructor: T, attr: U, validator?: ValidatorFunc>, after?: AfterFunc): void; overWriteSetter>(constructor: T, attr: U, validator?: ValidatorFunc>, after?: AfterFunc): void; addComponentsGetterSetter>(constructor: T, attr: U, components: ExtractComponents, validator?: ValidatorFunc>, after?: AfterFunc): void; addOverloadedGetterSetter>(constructor: T, attr: U): void; backCompat(constructor: T, methods: Record): void; afterSetFilter(this: Node): void; }; export {};