export declare type IndexMethod = (force?: boolean) => Promise; export declare type ShowMethod = (id: number, force?: boolean) => Promise; export declare type ShowMethodForSingular = (force?: boolean) => Promise; export declare type NewMethod = () => Promise; export declare type CreateMethod = (record?: object) => Promise; export declare type EditMethod = (id: number, force?: boolean) => Promise; export declare type UpdateMethod = (record?: object) => Promise; export declare type DestroyMethod = (id: number) => Promise; export declare type Action = 'index' | 'show' | 'new' | 'create' | 'edit' | 'update' | 'destroy'; export interface ActionExtension { [k: string]: (ctx: Context, payload: any) => void | Promise; } export interface MutationExtension { [k: string]: (state: State, payload: any) => void; } export interface StateExtension { [k: string]: any; } export interface State { [x: string]: any; } interface Extention { state?: StateExtension; mutations?: MutationExtension; actions?: ActionExtension; } export interface ActionConfig { useIndexActionInShowAction?: boolean; useShowActionInEditAction?: boolean; refreshPropertiesAlways?: boolean; isSingular?: boolean; } export interface Options { extention?: Extention; actionConfig?: ActionConfig; } export interface Resource { resource: string; action: Action; options?: Options; } export interface Config { requestCallback?: Function; axios?: any; actionConfig?: ActionConfig; } declare type Context = any; declare const Napi: { axios: any; requestCallback(_action: any, _resource: any, _query: any, _headers: any, _options: any, _obj?: {}): Promise; actionConfig: {}; setConfig(config: Config): void; createStore(resourceWithNamespace: string, actions: Action[], options?: Options): { state: () => State; mutations: { [x: string]: ((state: State, payload: any) => void) | ((state: any, { records, query }: { records: any; query: any; }) => void) | ((state: any, data: any) => void) | ((state: any, data: any) => void) | ((state: any, data: any) => void) | ((state: any, id: any) => void); }; actions: { [x: string]: ((ctx: any, payload: any) => void | Promise) | (({ commit, state }: { commit: any; state: any; }, { force: force, query: query, headers: headers }: { force: any; query: any; headers: any; }) => Promise) | (({ commit }: { commit: any; }) => void) | (({ commit, state }: { commit: any; state: any; }, { force: force, query: query, headers: headers }: { force: any; query: any; headers: any; }) => Promise) | (({ commit }: { commit: any; }) => void) | (({ commit, state }: { commit: any; state: any; }) => Promise) | (({ commit, state }: { commit: any; state: any; }, { query: query, headers: headers, record: record }: { query: any; headers: any; record: any; }) => Promise) | (({ commit, dispatch, state }: { commit: any; dispatch: any; state: any; }, { id: id, force: force, query: query, headers: headers }: { id: any; force: any; query: any; headers: any; }) => Promise) | (({ commit, state }: { commit: any; state: any; }, { query: query, headers: headers, record: record }: { query: any; headers: any; record: any; }) => Promise) | (({ commit }: { commit: any; }, { id: id, query: query, headers: headers }: { id: any; query: any; headers: any; }) => Promise); }; }; generateComputed: (resources: Resource[]) => { [x: string]: () => any; }; generateMethods: (resources: Resource[], { createHeaders, errorHandler }?: { createHeaders?: (app: import("vue").default) => object; errorHandler?: (e: any, app: import("vue").default) => void; }) => { [x: string]: IndexMethod | ShowMethod | ShowMethodForSingular | NewMethod | CreateMethod | EditMethod | UpdateMethod | DestroyMethod; }; generateFetch: (resources: Resource[], { createHeaders, errorHandler, queryHandler }?: { createHeaders?: (ctx: any) => object; errorHandler?: (e: any, ctx: any) => void; queryHandler?: (resourceWithNamespace: string, action: string, context: any) => Object; }) => (ctx: any) => void; }; export default Napi;