transformer.d.ts 1.1 KB

1234567891011121314151617
  1. import SuperJSON from './index.js';
  2. export declare type PrimitiveTypeAnnotation = 'number' | 'undefined' | 'bigint';
  3. declare type LeafTypeAnnotation = PrimitiveTypeAnnotation | 'regexp' | 'Date' | 'Error' | 'URL';
  4. declare type TypedArrayAnnotation = ['typed-array', string];
  5. declare type ClassTypeAnnotation = ['class', string];
  6. declare type SymbolTypeAnnotation = ['symbol', string];
  7. declare type CustomTypeAnnotation = ['custom', string];
  8. declare type SimpleTypeAnnotation = LeafTypeAnnotation | 'map' | 'set';
  9. declare type CompositeTypeAnnotation = TypedArrayAnnotation | ClassTypeAnnotation | SymbolTypeAnnotation | CustomTypeAnnotation;
  10. export declare type TypeAnnotation = SimpleTypeAnnotation | CompositeTypeAnnotation;
  11. export declare function isInstanceOfRegisteredClass(potentialClass: any, superJson: SuperJSON): potentialClass is any;
  12. export declare const transformValue: (value: any, superJson: SuperJSON) => {
  13. value: any;
  14. type: TypeAnnotation;
  15. } | undefined;
  16. export declare const untransformValue: (json: any, type: TypeAnnotation, superJson: SuperJSON) => any;
  17. export {};