plainer.d.ts 1.1 KB

12345678910111213141516
  1. import { TypeAnnotation } from './transformer.js';
  2. import SuperJSON from './index.js';
  3. declare type Tree<T> = InnerNode<T> | Leaf<T>;
  4. declare type Leaf<T> = [T];
  5. declare type InnerNode<T> = [T, Record<string, Tree<T>>];
  6. export declare type MinimisedTree<T> = Tree<T> | Record<string, Tree<T>> | undefined;
  7. export declare function applyValueAnnotations(plain: any, annotations: MinimisedTree<TypeAnnotation>, superJson: SuperJSON): any;
  8. export declare function applyReferentialEqualityAnnotations(plain: any, annotations: ReferentialEqualityAnnotations): any;
  9. interface Result {
  10. transformedValue: any;
  11. annotations?: MinimisedTree<TypeAnnotation>;
  12. }
  13. export declare type ReferentialEqualityAnnotations = Record<string, string[]> | [string[]] | [string[], Record<string, string[]>];
  14. export declare function generateReferentialEqualityAnnotations(identitites: Map<any, any[][]>, dedupe: boolean): ReferentialEqualityAnnotations | undefined;
  15. export declare const walker: (object: any, identities: Map<any, any[][]>, superJson: SuperJSON, dedupe: boolean, path?: any[], objectsInThisPath?: any[], seenObjects?: Map<unknown, Result>) => Result;
  16. export {};