diff.d.ts 755 B

123456789101112131415161718192021
  1. /// <reference types="react" />
  2. export declare const STATUS_ADD: "add";
  3. export declare const STATUS_KEEP: "keep";
  4. export declare const STATUS_REMOVE: "remove";
  5. export declare const STATUS_REMOVED: "removed";
  6. export type DiffStatus = typeof STATUS_ADD | typeof STATUS_KEEP | typeof STATUS_REMOVE | typeof STATUS_REMOVED;
  7. type RawKeyType = string | number;
  8. export interface KeyObject {
  9. key: RawKeyType;
  10. status?: DiffStatus;
  11. }
  12. export declare function wrapKeyToObject(key: React.Key | KeyObject): {
  13. key: string;
  14. status?: DiffStatus;
  15. };
  16. export declare function parseKeys(keys?: any[]): {
  17. key: string;
  18. status?: DiffStatus;
  19. }[];
  20. export declare function diffKeys(prevKeys?: KeyObject[], currentKeys?: KeyObject[]): KeyObject[];
  21. export {};