transformer.d.ts 1022 B

1234567891011121314151617
  1. import SuperJSON from './index.js';
  2. export type PrimitiveTypeAnnotation = 'number' | 'undefined' | 'bigint';
  3. type LeafTypeAnnotation = PrimitiveTypeAnnotation | 'regexp' | 'Date' | 'URL';
  4. type TypedArrayAnnotation = ['typed-array', string];
  5. type ClassTypeAnnotation = ['class', string];
  6. type SymbolTypeAnnotation = ['symbol', string];
  7. type CustomTypeAnnotation = ['custom', string];
  8. type SimpleTypeAnnotation = LeafTypeAnnotation | 'map' | 'set' | 'Error';
  9. type CompositeTypeAnnotation = TypedArrayAnnotation | ClassTypeAnnotation | SymbolTypeAnnotation | CustomTypeAnnotation;
  10. export 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 {};