UNPKG

1.7 kBTypeScriptView Raw
1import { InjectionToken, Provider } from '@angular/core';
2import { NgxWebstorageConfiguration } from './config';
3export declare const LIB_CONFIG: InjectionToken<NgxWebstorageConfiguration>;
4export declare enum InternalNgxWebstorageFeatureKind {
5 Config = 1,
6 LocalStorage = 2,
7 SessionStorage = 3
8}
9export type NgxWebstorageFeatureKind = string | InternalNgxWebstorageFeatureKind;
10export type NgxWebstorageFeature<FeatureKind extends NgxWebstorageFeatureKind> = {
11 kind: FeatureKind;
12 providers: Provider[];
13};
14/**
15 * Provide ngx-webstorage basic features.
16 *
17 * - You can customise the configuration with the `withConfiguration` feature.
18 * - You can enable the `LocalStorage` features with the `withLocalStorage` feature.
19 * - You can enable the `SessionStorage` features with the `withSessionStorage` feature.
20 *
21 * @default config { prefix: 'ngx-webstorage', separator: '|', caseSensitive: false }
22 */
23export declare function provideNgxWebstorage(...features: NgxWebstorageFeature<NgxWebstorageFeatureKind>[]): import("@angular/core").EnvironmentProviders;
24export declare function makeNgxWebstorageFeature<FeatureKind extends NgxWebstorageFeatureKind>(kind: FeatureKind, providers: Provider[]): NgxWebstorageFeature<FeatureKind>;
25export declare function withNgxWebstorageConfig(config: NgxWebstorageConfiguration): NgxWebstorageFeature<InternalNgxWebstorageFeatureKind.Config>;
26/** Provides everything necessary to use the `LocalStorage` features. */
27export declare function withLocalStorage(): NgxWebstorageFeature<InternalNgxWebstorageFeatureKind.LocalStorage>;
28export declare function withSessionStorage(): NgxWebstorageFeature<InternalNgxWebstorageFeatureKind.SessionStorage>;