Options
All
  • Public
  • Public/Protected
  • All
Menu

storage-settings

Index

Functions

  • createStorageSettings<Settings>(shape: Settings & { readonly [ Key in string | number | symbol]: { default: SuccessOf<ReturnType<Settings[Key]["map"]>> } }, storage: Pick<Storage, "clear" | "getItem" | "removeItem" | "setItem">): PrettyType<StorageSettings<Settings>>
  • createStorageSettings<Settings>(shape: Settings & { readonly [ Key in string | number | symbol]: { default: SuccessOf<ReturnType<Settings[Key]["map"]>> } }): ((storage: StorageMapInit) => PrettyType<StorageSettings<Settings>>)
  • Creates storage settings.

    Type Parameters

    • Settings extends Readonly<Record<string, Setting>>

    Parameters

    • shape: Settings & { readonly [ Key in string | number | symbol]: { default: SuccessOf<ReturnType<Settings[Key]["map"]>> } }

      An object that maps setting name to validating transform and default value.

    • storage: Pick<Storage, "clear" | "getItem" | "removeItem" | "setItem">

      A Storage-like object

    Returns PrettyType<StorageSettings<Settings>>

  • Creates storage settings. Curried version.

    Type Parameters

    • Settings extends Readonly<Record<string, Setting>>

    Parameters

    • shape: Settings & { readonly [ Key in string | number | symbol]: { default: SuccessOf<ReturnType<Settings[Key]["map"]>> } }

      An object that maps setting name to validating transform and default value.

    Returns ((storage: StorageMapInit) => PrettyType<StorageSettings<Settings>>)

    A function that takes a Storage-like object and return storage settings object.

      • (storage: StorageMapInit): PrettyType<StorageSettings<Settings>>
      • Creates storage settings. Curried version.

        Parameters

        • storage: StorageMapInit

        Returns PrettyType<StorageSettings<Settings>>

        A function that takes a Storage-like object and return storage settings object.

Generated using TypeDoc