typescript-class-helpers
Version:
Usefull helper to have in your typescript project
84 lines • 2.11 kB
TypeScript
// @ts-nocheck
import { CoreModels } from 'tnp-core/websql';
export declare namespace Models {
/**
* @deprecated
*/
type CLASSNAMEOptions = {
uniqueKey?: string;
/**
* autoinstance - create instance of singleton automaticly inside decorator
* first-instance - use first instace of created class as decorator
*/
singleton?: 'autoinstance' | 'first-instance' | 'last-instance' | boolean;
classFamily?: string;
classNameInBrowser?: string;
};
/**
* @deprecated
*/
class ParamConfig {
paramName: string;
paramType: CoreModels.ParamType;
index: number;
defaultType: any;
expireInSeconds?: number;
}
/**
* @deprecated
*/
class MethodConfig {
methodName: string;
/**
* path is global in express app
*/
global?: boolean;
/**
* override default content type
*/
contentType?: any;
/**
* override default axiso response type
*/
responseType?: any;
path: string;
descriptor: PropertyDescriptor;
type: CoreModels.HttpMethod;
requestHandler: any;
parameters: {
[paramName: string]: ParamConfig;
};
}
/**
* @deprecated
*/
interface ClassMeta {
uniqueKey?: string;
className?: string;
classFamily?: string;
classNameInBrowser?: string;
target?: Function;
}
/**
* @deprecated
*/
class ClassConfig {
browserTransformFn?: (entity: any) => any;
singleton: Object;
injections: {
getter: Function;
propertyName: string;
}[];
calculatedPath: string;
path: string;
vChildren?: ClassConfig[];
vParent?: ClassConfig;
classReference: Function;
className?: string;
uniqueKey?: string;
classNameInBrowser?: string;
methods: {
[methodName: string]: MethodConfig;
};
}
}