npm.io
0.3.39 • Published 2 years ago

@types/ngstorage

Licence
MIT
Version
0.3.39
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/ngstorage

Summary

This package contains type definitions for ngstorage (https://github.com/gsklee/ngStorage).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ngstorage.

index.d.ts

export namespace ngStorage {
    interface StorageService {
        /**
         * @return true if the storage service is supported by the browser.
         */
        $supported(): boolean;

        /**
         * Adds default values to the store.
         * Copies all properties of the default items to the store.
         * If the store already has one of these properties it will skip it.
         *
         * @param items object holding the default values.
         * @return the modified storage service.
         */
        $default<T>(items: T): StorageService & T;

        /**
         * Removes all properties from the store.
         *
         * @param items optional object holding the default values to initialize the store after reset.
         * @return the modified storage service.
         */
        $reset<T>(items?: T): StorageService & T;

        $apply(): void;
        $sync(): void;

        /**
         * Access to the properties of the store.
         */
        [key: string]: any;
    }

    interface StorageProvider extends angular.IServiceProvider {
        get<T>(key: string): T | boolean;
        set<T>(key: string, value: T): T | boolean;
        remove(key: string): void;

        supported(): boolean;
        setKeyPrefix(prefix: string): void;
        setSerializer(serializer: (value: any) => string): void;
        setDeserializer(deserializer: (value: string) => any): void;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: none

Credits

These definitions were written by Jakub Pistek.