@snap/camera-kit
Version:
Camera Kit Web
16 lines • 890 B
TypeScript
import type { Guard } from "./typeguards";
/**
* Returns type string of a value. It mostly mimics the behavior of typeof, but for non-primitives
* (i.e. objects and functions), it returns a more granular type name where possible. Source:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#custom_method_that_gets_a_more_specific_type
*/
export declare function getTypeName(value: unknown): string;
/**
* Decorator to validate method arguments.
* @param guards Parameter guards to validate arguments.
* @returns
*/
export declare function validate<This, Args extends any[], Return>(...guards: {
[K in keyof Args]: Guard<Args[K]>;
}): (target: (this: This, ...args: Args) => Return, context: ClassMethodDecoratorContext<This, (this: This, ...args: Args) => Return>) => (this: This, ...args: Args) => Return;
//# sourceMappingURL=validate.d.ts.map