@types/deep-diff

  • Version 1.0.1
  • Published
  • 5.13 kB
  • No dependencies
  • MIT license

Install

npm i @types/deep-diff
yarn add @types/deep-diff
pnpm add @types/deep-diff

Overview

TypeScript definitions for deep-diff

Index

Functions

function applyChange

applyChange: <LHS>(target: LHS, source: any, change: Diff<LHS, any>) => void;

    function applyDiff

    applyDiff: <LHS, RHS = LHS>(
    target: LHS,
    source: RHS,
    filter?: Filter<LHS, RHS>
    ) => void;

      function diff

      diff: {
      <LHS, RHS = LHS>(lhs: LHS, rhs: RHS, prefilter?: PreFilter<LHS, RHS>):
      | Array<Diff<LHS, RHS>>
      | undefined;
      <LHS, RHS = LHS>(
      lhs: LHS,
      rhs: RHS,
      prefilter?: PreFilter<LHS, RHS>,
      acc?: Accumulator<LHS, RHS>
      ): Accumulator<LHS, RHS>;
      };

        function observableDiff

        observableDiff: <LHS, RHS = LHS>(
        lhs: LHS,
        rhs: RHS,
        observer?: Observer<LHS, RHS>,
        prefilter?: PreFilter<LHS, RHS>,
        orderIndependent?: boolean
        ) => Array<Diff<LHS, RHS>>;

          function orderIndependentDeepDiff

          orderIndependentDeepDiff: <LHS, RHS = LHS>(
          lhs: LHS,
          rhs: RHS,
          changes: Array<Diff<LHS, RHS>>,
          prefilter: PreFilter<LHS, RHS>,
          path: any[],
          key: any,
          stack: any[]
          ) => void;

            function orderIndependentDiff

            orderIndependentDiff: {
            <LHS, RHS = LHS>(lhs: LHS, rhs: RHS, prefilter?: PreFilter<LHS, RHS>):
            | Array<Diff<LHS, RHS>>
            | undefined;
            <LHS, RHS = LHS>(
            lhs: LHS,
            rhs: RHS,
            prefilter?: PreFilter<LHS, RHS>,
            acc?: Accumulator<LHS, RHS>
            ): Accumulator<LHS, RHS>;
            };

              function orderIndepHash

              orderIndepHash: (object: any) => number;

                function revertChange

                revertChange: <LHS>(target: LHS, source: any, change: Diff<LHS, any>) => void;

                  Interfaces

                  interface Accumulator

                  interface Accumulator<LHS, RHS = LHS> {}

                    property length

                    length: number;

                      method push

                      push: (diff: Diff<LHS, RHS>) => void;

                        interface DiffArray

                        interface DiffArray<LHS, RHS = LHS> {}

                          property index

                          index: number;

                            property item

                            item: Diff<LHS, RHS>;

                              property kind

                              kind: 'A';

                                property path

                                path?: any[] | undefined;

                                  interface DiffDeleted

                                  interface DiffDeleted<LHS> {}

                                    property kind

                                    kind: 'D';

                                      property lhs

                                      lhs: LHS;

                                        property path

                                        path?: any[] | undefined;

                                          interface DiffEdit

                                          interface DiffEdit<LHS, RHS = LHS> {}

                                            property kind

                                            kind: 'E';

                                              property lhs

                                              lhs: LHS;

                                                property path

                                                path?: any[] | undefined;

                                                  property rhs

                                                  rhs: RHS;

                                                    interface DiffNew

                                                    interface DiffNew<RHS> {}

                                                      property kind

                                                      kind: 'N';

                                                        property path

                                                        path?: any[] | undefined;

                                                          property rhs

                                                          rhs: RHS;

                                                            interface PreFilterObject

                                                            interface PreFilterObject<LHS, RHS = LHS> {}

                                                              method normalize

                                                              normalize: (
                                                              currentPath: any,
                                                              key: any,
                                                              lhs: LHS,
                                                              rhs: RHS
                                                              ) => [LHS, RHS] | undefined;

                                                                method prefilter

                                                                prefilter: (path: any[], key: any) => boolean;

                                                                  Type Aliases

                                                                  type Diff

                                                                  type Diff<LHS, RHS = LHS> =
                                                                  | DiffNew<RHS>
                                                                  | DiffDeleted<LHS>
                                                                  | DiffEdit<LHS, RHS>
                                                                  | DiffArray<LHS, RHS>;

                                                                    type Filter

                                                                    type Filter<LHS, RHS = LHS> = (
                                                                    target: LHS,
                                                                    source: RHS,
                                                                    change: Diff<LHS, RHS>
                                                                    ) => boolean;

                                                                      type Observer

                                                                      type Observer<LHS, RHS = LHS> = (diff: Diff<LHS, RHS>) => void;

                                                                        type PreFilter

                                                                        type PreFilter<LHS, RHS = LHS> = PreFilterFunction | PreFilterObject<LHS, RHS>;

                                                                          type PreFilterFunction

                                                                          type PreFilterFunction = (path: any[], key: any) => boolean;

                                                                            Package Files (1)

                                                                            Dependencies (0)

                                                                            No dependencies.

                                                                            Dev Dependencies (0)

                                                                            No dev dependencies.

                                                                            Peer Dependencies (0)

                                                                            No peer dependencies.

                                                                            Badge

                                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/deep-diff.

                                                                            • Markdown
                                                                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/deep-diff)
                                                                            • HTML
                                                                              <a href="https://www.jsdocs.io/package/@types/deep-diff"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>