# All files / lib/util types.js

100% Statements 54/54
100% Branches 1/1
0% Functions 0/1
100% Lines 54/54

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    553x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x
     /**
     * @type {{ [type: string]: any }}
     */
    export const EMPTY = {
      OBJ: {},
      ARR: [],
      BOOL: true,
      FUN: () => {},
    };

    /**
     * @typedef {any[]} ActiveTreeCache
     * @type {ActiveTreeCache}
     */
    export const ActiveRenderState = [];

    export const ComponentTreeCache = new Map();

    /**
     * @typedef {Map<VTree, any>} InstanceCache
     * @type {InstanceCache}
     */
    export const InstanceCache = new Map();

    /**
     * @typedef {Function} RenderFunction
     *
     * @property {Props} props
     * @property {State} state
     *
     * @returns {VTree[] | VTree | null | undefined}
     */
    export const RenderFunction = EMPTY.OBJ;

    /** @typedef {{ [key: string]: any }} Props */
    export const Props = EMPTY.OBJ;

    /** @typedef {{ [key: string]: any }} Context */
    export const Context = EMPTY.OBJ;

    /** @typedef {{ [key: string]: any }} State */
    export const State = EMPTY.OBJ;

    /** @typedef {import('diffhtml/dist/typings/util/types').ValidNode & { shadowRoot: any }} ValidNode */
    export const ValidNode = EMPTY.OBJ;

    /** @typedef {import('diffhtml/dist/typings/util/types').VTree} VTree */
    export const VTree = EMPTY.OBJ;

    /** @typedef {import('diffhtml/dist/typings/transaction').default} Transaction */
    export const Transaction = EMPTY.OBJ;

    /** @typedef {import('diffhtml/dist/typings/index')} DIFF_BINDING */
    export const DIFF_BINDING = EMPTY.OBJ;