import { PrimitiveOrNested } from 'keyweaver'; import { h as Storage, c as LoadableStateScope, L as LoadableState, f as PollableStateScope, P as PollableState, b as AsyncStateScope, A as AsyncState, a as StateScope, l as StorageRecord, i as PaginatedStorage, W as WithInitModule, e as AsyncStateOptions, d as LoadableStateOptions, R as RequestableStateOptions, g as PollableStateOptions, S as State, m as PollableMethods } from '../types-5EvFF6wb.cjs'; import createState from '../createState/index.cjs'; import createAsyncState from '../createAsyncState/index.cjs'; import createStateScope from '../createStateScope/index.cjs'; import createAsyncStateScope from '../createAsyncStateScope/index.cjs'; import createRequestableState from '../createRequestableState/index.cjs'; import createRequestableStateScope from '../createRequestableStateScope/index.cjs'; import createPollableState from '../createPollableState/index.cjs'; import createPollableStateScope from '../createPollableStateScope/index.cjs'; import createPaginatedStorage, { PaginatedRequestableStateArgs, PaginatedRequestableNestedStateArgs, PaginatedPollableNestedStateArgs, PaginatedPollableStateArgs } from '../createPaginatedStorage/index.cjs'; import 'react'; type StateCreator = typeof createState | typeof createStateScope; type GetStateArgs = WithInitModule T) ]>; type AsyncStateCreator = typeof createAsyncState | typeof createAsyncStateScope; type AsyncGetStateArgs = WithInitModule ]>; type LoadableStateArgs = WithInitModule ]>; type RequestableStateCreator = typeof createRequestableState | typeof createRequestableStateScope; type RequestableStateArgs = WithInitModule ]>; type PollableStateCreator = typeof createPollableState | typeof createPollableStateScope; type PollableStateArgs = WithInitModule ]>; type StateCreationArguments = T extends LoadableState | LoadableStateScope ? C extends PollableMethods ? PollableStateArgs : [C] extends [never] ? RequestableStateArgs | LoadableStateArgs : LoadableStateArgs : T extends AsyncState ? AsyncGetStateArgs : T extends State ? GetStateArgs : never; type PaginatedStorageArgs, Keys extends PrimitiveOrNested[], ParentKeys extends PrimitiveOrNested[]> = T extends PaginatedStorage ? WithCreatePaginatedStorage ? PaginatedPollableNestedStateArgs : S extends PollableState ? PaginatedPollableStateArgs : S extends LoadableStateScope ? PaginatedRequestableNestedStateArgs : S extends LoadableState ? PaginatedRequestableStateArgs : never> : never; type StorageRecordArgs = { [key in keyof T]: T[key] extends State ? StateCreationArguments : T[key] extends Storage ? S extends StorageRecord ? WithCreateStateStorage<[ StorageRecordArgs ]> : S extends State ? WithCreateStateStorage> : S extends PaginatedStorage ? WithCreateStateStorage> : never : never; }; type WithCreatePaginatedStorage = [ typeof createPaginatedStorage, ...T ]; type WithCreateStateStorage = [CreateStorage, ...T]; interface CreateStorage { (...args: LoadableStateArgs): Storage, Keys>; (...args: LoadableStateArgs): Storage, Keys>; (...args: PollableStateArgs): Storage, Keys>; (...args: PollableStateArgs): Storage, Keys>; (...args: AsyncGetStateArgs): Storage, Keys>; (...args: AsyncGetStateArgs): Storage, Keys>; (...args: RequestableStateArgs): Storage, Keys>; (...args: RequestableStateArgs): Storage, Keys>; (...args: GetStateArgs): Storage, Keys>; (...args: GetStateArgs): Storage, Keys>; (obj: StorageRecordArgs): Storage; (...args: WithCreatePaginatedStorage>): Storage>, Keys>; (...args: WithCreatePaginatedStorage>): Storage>, Keys>; } declare const createStorage: CreateStorage; export { Storage, createStorage as default };