@glimmer/util

  • Version 0.56.2
  • Published
  • 319 kB
  • 3 dependencies
  • MIT license

Install

npm i @glimmer/util
yarn add @glimmer/util
pnpm add @glimmer/util

Overview

Common utilities used in Glimmer

Index

Variables

variable beginTestSteps

let beginTestSteps: () => void;

    variable debugToString

    let debugToString: (value: unknown) => string;

      variable EMPTY_ARRAY

      const EMPTY_ARRAY: any[];

        variable endTestSteps

        let endTestSteps: () => void;

          variable logStep

          let logStep: (type: string, steps: unknown) => void;

            variable SERIALIZATION_FIRST_NODE_STRING

            const SERIALIZATION_FIRST_NODE_STRING: string;

              variable verifySteps

              let verifySteps: (
              type: string,
              steps: unknown[] | ((steps: unknown[]) => void),
              message?: string
              ) => void;

                Functions

                function assert

                assert: (test: any, msg: string) => void;

                  function assertNever

                  assertNever: (value: never, desc?: string) => void;

                    function assign

                    assign: {
                    <T, U>(obj: T, assignments: U): T & U;
                    <T, U, V>(obj: T, a: U, b: V): T & U & V;
                    <T, U, V, W>(obj: T, a: U, b: V, c: W): T & U & V & W;
                    <T, U, V, W, X>(obj: T, a: U, b: V, c: W, d: X): T & U & V & W & X;
                    <T, U, V, W, X, Y>(obj: T, a: U, b: V, c: W, d: X, e: Y): T & U & V & W & X & Y;
                    <T, U, V, W, X, Y, Z>(obj: T, a: U, b: V, c: W, d: X, e: Y, f: Z): T &
                    U &
                    V &
                    W &
                    X &
                    Y &
                    Z;
                    (target: any, ...args: any[]): any;
                    };

                      function clearElement

                      clearElement: (parent: any) => void;

                        function constants

                        constants: (...values: unknown[]) => unknown[];

                          function decodeHandle

                          decodeHandle: (num: number) => number;

                            function decodeImmediate

                            decodeImmediate: (num: number) => number;

                              function decodeNegative

                              decodeNegative: (num: number) => number;

                                function decodePositive

                                decodePositive: (num: number) => number;

                                  function deprecate

                                  deprecate: (desc: string) => void;

                                    function dict

                                    dict: <T = unknown>() => any;

                                      function encodeHandle

                                      encodeHandle: (num: number) => number;

                                        function encodeImmediate

                                        encodeImmediate: (num: number) => number;

                                          function encodeNegative

                                          encodeNegative: (num: number) => number;

                                            function encodePositive

                                            encodePositive: (num: number) => number;

                                              function ensureGuid

                                              ensureGuid: (object: HasGuid) => number;

                                                function exhausted

                                                exhausted: (value: never) => never;

                                                  function expect

                                                  expect: <T>(val: Maybe<T>, message: string) => T;

                                                    function extractHandle

                                                    extractHandle: (handle: any) => number;

                                                      function fillNulls

                                                      fillNulls: <T>(count: number) => T[];

                                                        function initializeGuid

                                                        initializeGuid: (object: HasGuid) => number;

                                                          function isDict

                                                          isDict: <T>(u: T) => u is any;

                                                            function isErrHandle

                                                            isErrHandle: (handle: any) => handle is any;

                                                              function isHandle

                                                              isHandle: (value: number) => boolean;

                                                                function isNonPrimitiveHandle

                                                                isNonPrimitiveHandle: (value: number) => boolean;

                                                                  function isObject

                                                                  isObject: <T>(u: T) => u is object & T;

                                                                    function isOkHandle

                                                                    isOkHandle: (handle: any) => handle is any;

                                                                      function isSerializationFirstNode

                                                                      isSerializationFirstNode: (node: any) => boolean;

                                                                        function isSmallInt

                                                                        isSmallInt: (value: number) => boolean;

                                                                          function keys

                                                                          keys: <T>(obj: T) => Array<keyof T>;

                                                                            function strip

                                                                            strip: (strings: TemplateStringsArray, ...args: unknown[]) => string;

                                                                              function symbol

                                                                              symbol: (key: string) => any;

                                                                                function tuple

                                                                                tuple: <T extends Lit[]>(...args: T) => T;

                                                                                  function unreachable

                                                                                  unreachable: (message?: string) => Error;

                                                                                    function unwrap

                                                                                    unwrap: <T>(val: Maybe<T>) => T;

                                                                                      function unwrapHandle

                                                                                      unwrapHandle: (handle: any) => number;

                                                                                        function unwrapTemplate

                                                                                        unwrapTemplate: <M>(template: any) => any;

                                                                                          function values

                                                                                          values: <T>(obj: { [s: string]: T }) => T[];

                                                                                            Classes

                                                                                            class DictSet

                                                                                            class DictSet<T extends SetMember> implements Set<T> {}

                                                                                              constructor

                                                                                              constructor();

                                                                                                method add

                                                                                                add: (obj: T) => Set<T>;

                                                                                                  method delete

                                                                                                  delete: (obj: T) => void;

                                                                                                    class Stack

                                                                                                    class StackImpl<T> implements Stack<T> {}

                                                                                                      property current

                                                                                                      current: {};

                                                                                                        property size

                                                                                                        readonly size: number;

                                                                                                          method isEmpty

                                                                                                          isEmpty: () => boolean;

                                                                                                            method nth

                                                                                                            nth: (from: number) => Option<T>;

                                                                                                              method pop

                                                                                                              pop: () => Option<T>;

                                                                                                                method push

                                                                                                                push: (item: T) => void;

                                                                                                                  method toArray

                                                                                                                  toArray: () => T[];

                                                                                                                    Interfaces

                                                                                                                    interface HasGuid

                                                                                                                    interface HasGuid {}

                                                                                                                      interface Set

                                                                                                                      interface Set<T> {}

                                                                                                                        method add

                                                                                                                        add: (value: T) => Set<T>;

                                                                                                                          method delete

                                                                                                                          delete: (value: T) => void;

                                                                                                                            Enums

                                                                                                                            enum ImmediateConstants

                                                                                                                            const enum ImmediateConstants {
                                                                                                                            MAX_SMI = 1073741823,
                                                                                                                            MIN_SMI = -1073741824,
                                                                                                                            SIGN_BIT = -536870913,
                                                                                                                            MAX_INT = 536870911,
                                                                                                                            MIN_INT = -536870912,
                                                                                                                            FALSE_HANDLE = 0,
                                                                                                                            TRUE_HANDLE = 1,
                                                                                                                            NULL_HANDLE = 2,
                                                                                                                            UNDEFINED_HANDLE = 3,
                                                                                                                            ENCODED_FALSE_HANDLE = 0,
                                                                                                                            ENCODED_TRUE_HANDLE = 1,
                                                                                                                            ENCODED_NULL_HANDLE = 2,
                                                                                                                            ENCODED_UNDEFINED_HANDLE = 3,
                                                                                                                            }

                                                                                                                              member ENCODED_FALSE_HANDLE

                                                                                                                              ENCODED_FALSE_HANDLE = 0

                                                                                                                                member ENCODED_NULL_HANDLE

                                                                                                                                ENCODED_NULL_HANDLE = 2

                                                                                                                                  member ENCODED_TRUE_HANDLE

                                                                                                                                  ENCODED_TRUE_HANDLE = 1

                                                                                                                                    member ENCODED_UNDEFINED_HANDLE

                                                                                                                                    ENCODED_UNDEFINED_HANDLE = 3

                                                                                                                                      member FALSE_HANDLE

                                                                                                                                      FALSE_HANDLE = 0

                                                                                                                                        member MAX_INT

                                                                                                                                        MAX_INT = 536870911

                                                                                                                                          member MAX_SMI

                                                                                                                                          MAX_SMI = 1073741823

                                                                                                                                            member MIN_INT

                                                                                                                                            MIN_INT = -536870912

                                                                                                                                              member MIN_SMI

                                                                                                                                              MIN_SMI = -1073741824

                                                                                                                                                member NULL_HANDLE

                                                                                                                                                NULL_HANDLE = 2

                                                                                                                                                  member SIGN_BIT

                                                                                                                                                  SIGN_BIT = -536870913

                                                                                                                                                    member TRUE_HANDLE

                                                                                                                                                    TRUE_HANDLE = 1

                                                                                                                                                      member UNDEFINED_HANDLE

                                                                                                                                                      UNDEFINED_HANDLE = 3

                                                                                                                                                        Type Aliases

                                                                                                                                                        type Factory

                                                                                                                                                        type Factory<T> = new (...args: unknown[]) => T;

                                                                                                                                                          type FIXME

                                                                                                                                                          type FIXME<T, S extends string> = (T & S) | T;

                                                                                                                                                            type Lit

                                                                                                                                                            type Lit = string | number | boolean | undefined | null | void | {};

                                                                                                                                                              type Maybe

                                                                                                                                                              type Maybe<T> = Option<T> | undefined | void;

                                                                                                                                                                type Option

                                                                                                                                                                type Option<T> = T | null;

                                                                                                                                                                  Package Files (14)

                                                                                                                                                                  Dependencies (3)

                                                                                                                                                                  Dev Dependencies (3)

                                                                                                                                                                  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/@glimmer/util.

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