UNPKG

@excentone/spfx-react

Version:

Contains custom ReactJs components and hooks intended to use when developing SharePoint Framework (SPFx) Web components.

11 lines (10 loc) 654 B
import { ActionWithoutArgs } from "@excentone/spfx-utilities"; import { Dispatch, SetStateAction } from "react"; export interface IPnpClientStorageOperation<T> { setState: Dispatch<SetStateAction<Partial<T>>>; resetState: ActionWithoutArgs; getOrInitState: () => Promise<Partial<T>>; } export declare type PnpClientStorageHook<T> = readonly [Partial<T>, IPnpClientStorageOperation<T>]; export declare const usePnpLocalStorage: <T>(key: string, initialValue: Partial<T>, expire?: Date) => PnpClientStorageHook<T>; export declare const usePnpSessionStorage: <T>(key: string, initialValue: Partial<T>, expire?: Date) => PnpClientStorageHook<T>;