@deep-foundation/deeplinks
Version:
[](https://www.npmjs.com/package/@deep-foundation/deeplinks) [](https://gitpod.io/#https://github.com/deep-fo
618 lines (617 loc) • 27 kB
TypeScript
/// <reference types="node" />
import type { ApolloQueryResult } from '@apollo/client/index.js';
import { Observable, gql } from '@apollo/client/index.js';
import { IApolloClient } from '@deep-foundation/hasura/client.js';
import React from "react";
import { BoolExpCan, BoolExpHandler, BoolExpSelector, BoolExpTree, BoolExpValue, MutationInputLink, MutationInputLinkPlain, MutationInputValue, QueryLink } from './client_types.js';
import { Id, Link, MinilinkCollection, MinilinkError, MinilinksLink, MinilinksQueryOptions, MinilinksResult } from './minilinks.js';
import { Traveler as NativeTraveler, Traveler } from './traveler.js';
import { Packager } from './packager.js';
import EventEmitter from 'events';
import { Packages } from './packages.js';
export declare const random: () => string;
export declare function upload(linkId: any, file: Blob | string, deep: any): Promise<void>;
export declare const _ids: {
'@deep-foundation/core': {
[key: string]: Id;
[key: number]: Id;
};
};
interface SerializeTable {
returning: string;
virtualize?: {
[key: string]: string[];
};
fields?: {
[key: string]: string;
};
relations?: {
[key: string]: string;
};
}
interface Serialize {
[key: string]: SerializeTable;
}
export declare const _serialize: Serialize;
export declare const _boolExpFields: {
_and: boolean;
_not: boolean;
_or: boolean;
};
export declare const pathToWhere: (start: (DeepClientStartItem), ...path: DeepClientPathItem[]) => any;
export declare const serializeWhere: (exp: any, env?: string, unvertualizeId?: (id: Id) => Id, globalExp?: any) => any;
export declare const serializeQuery: (exp: any, env?: string, unvertualizeId?: (id: Id) => Id) => any;
export declare function parseJwt(token: any): {
userId: Id;
role: string;
roles: string[];
[key: string]: any;
};
export interface Handler {
handler_id: number;
dist_id: number;
src_id: number;
}
export interface SubscriptionI {
closed: boolean;
unsubscribe(): void;
}
export interface Observer<T> {
start?(subscription: SubscriptionI): any;
next?(value: T): void;
error?(errorValue: any): void;
complete?(): void;
}
export interface DeepClientOptions<L extends Link<Id> = Link<Id>> {
namespace?: string;
needConnection?: boolean;
path?: string;
ssl?: boolean;
linkId?: Id;
token?: string;
secret?: string;
ws?: boolean;
handleAuth?: (linkId?: Id, token?: string) => any;
handleOperation?: (operation: string, query?: any, value?: any, options?: any) => any;
deep?: DeepClientInstance<L>;
self?: DeepClientInstance<L>;
apolloClient?: IApolloClient<any>;
minilinks?: MinilinkCollection<any, Link<Id>>;
ml?: MinilinkCollection<any, Link<Id>>;
table?: string;
returning?: string;
selectReturning?: string;
linksSelectReturning?: string;
selectorsSelectReturning?: string;
canSelectReturning?: string;
treeSelectReturning?: string;
valuesSelectReturning?: string;
filesSelectReturning?: string;
handlersSelectReturning?: string;
insertReturning?: string;
updateReturning?: string;
deleteReturning?: string;
defaultSelectName?: string;
defaultInsertName?: string;
defaultUpdateName?: string;
defaultDeleteName?: string;
silent?: boolean;
unsafe?: any;
remote?: boolean;
local?: boolean;
}
export interface DeepClientResult<R> extends ApolloQueryResult<R> {
query?: any;
error?: any;
data: any;
originalData?: any;
plainLinks?: any;
subscribe?: (observer: Observer<any>) => SubscriptionI;
travel?: (query?: Exp) => Traveler;
}
export type DeepClientPackageSelector = string;
export type DeepClientPackageContain = string;
export type DeepClientLinkId = Id;
export type DeepClientStartItem = DeepClientPackageSelector | DeepClientLinkId;
export type DeepClientPathItem = DeepClientPackageContain | boolean;
export interface DeepSearchOptions {
remote?: boolean;
regexp?: boolean;
query?: Exp;
values?: boolean;
contains?: boolean;
sort?: boolean;
skip?: boolean;
count?: boolean;
apply?: string;
subscription?: boolean;
debounce?: number | boolean;
}
export interface DeepClientInstance<L extends Link<Id> = Link<Id>> {
namespace?: string;
linkId?: Id;
token?: string;
secret?: string;
ssl?: boolean;
ws?: boolean;
handleAuth?: (linkId?: Id, token?: string) => any;
handleOperation?: (operation: string, query?: any, value?: any, options?: any) => any;
deep: DeepClientInstance<L>;
DeepClient: typeof DeepClient;
gql: typeof gql;
apolloClient: IApolloClient<any>;
minilinks: MinilinksResult<L>;
ml: MinilinksResult<L>;
table?: string;
returning?: string;
selectReturning?: string;
linksSelectReturning?: string;
selectorsSelectReturning?: string;
canSelectReturning?: string;
treeSelectReturning?: string;
valuesSelectReturning?: string;
filesSelectReturning?: string;
handlersSelectReturning?: string;
insertReturning?: string;
updateReturning?: string;
deleteReturning?: string;
defaultSelectName?: string;
defaultInsertName?: string;
defaultUpdateName?: string;
defaultDeleteName?: string;
unsafe?: any;
stringify(any?: any): string;
one(exp: Exp<'links'> | Id): Promise<L>;
select<TTable extends 'links' | 'numbers' | 'strings' | 'objects' | 'can' | 'selectors' | 'tree' | 'handlers', LL = L>(exp: Exp<TTable>, options?: ReadOptions<TTable>): Promise<DeepClientResult<LL[] | number>>;
subscribe<TTable extends 'links' | 'numbers' | 'strings' | 'objects' | 'can' | 'selectors' | 'tree' | 'handlers', LL = L>(exp: Exp<TTable>, options?: ReadOptions<TTable>): Observable<DeepClientResult<LL[] | number>>;
insert<TTable extends 'links' | 'numbers' | 'strings' | 'objects', LL = L>(objects: InsertObjects<TTable>, options?: WriteOptions<TTable>): Promise<DeepClientResult<{
id: any;
}[]>>;
update<TTable extends 'links' | 'numbers' | 'strings' | 'objects'>(exp: Exp<TTable>, value: UpdateValue<TTable>, options?: WriteOptions<TTable>): Promise<DeepClientResult<{
id: any;
}[]>>;
delete<TTable extends 'links' | 'numbers' | 'strings' | 'objects'>(exp: Exp<TTable>, options?: WriteOptions<TTable>): Promise<DeepClientResult<{
id: any;
}[]>>;
serial(options: AsyncSerialParams): Promise<DeepClientResult<{
id: any;
}[]>>;
reserve<LL = L>(count: number): Promise<Id[]>;
await(id: Id): Promise<boolean>;
value(id: Id, value?: string | number | Object): Promise<{
id: Id;
link?: Link<Id>;
Value?: Link<Id>;
data: string | number | Object;
[key: string]: any;
}>;
serializeWhere(exp: any, env?: string): any;
serializeQuery(exp: any, env?: string): any;
unvertualizeId(id: Id): Id;
id(start: DeepClientStartItem | Exp, ...path: DeepClientPathItem[]): Promise<Id>;
idLocal(start: DeepClientStartItem, ...path: DeepClientPathItem[]): Id;
name(input: Link<Id> | Id): Promise<string | null>;
nameLocal(input: Link<Id> | Id): string | null;
symbol(input: Link<Id> | Id): Promise<string | null>;
symbolLocal(input: Link<Id> | Id): string | null;
guest(options: DeepClientGuestOptions): Promise<DeepClientAuthResult>;
jwt(options: DeepClientJWTOptions): Promise<DeepClientAuthResult>;
login(options: DeepClientJWTOptions): Promise<DeepClientAuthResult>;
logout(): Promise<DeepClientAuthResult>;
can(objectIds: Id[], subjectIds: Id[], actionIds: Id[]): Promise<boolean>;
useId: typeof useDeepId;
useDeepId: typeof useDeepId;
useLink: typeof useLink;
useLinks: typeof useLinks;
useSubscription: typeof useDeepSubscription;
useDeepSubscription: typeof useDeepSubscription;
useQuery: typeof useDeepQuery;
useDeepQuery: typeof useDeepQuery;
useMinilinksQuery: (query: Exp, options?: MinilinksQueryOptions) => L[];
useMinilinksSubscription: (query: Exp, options?: MinilinksQueryOptions) => L[];
useMinilinksId: (start: DeepClientStartItem | QueryLink, ...path: DeepClientPathItem[]) => Id | void;
useMinilinksApply(data: any, name: string): any;
useLocalQuery: (query: Exp, options?: MinilinksQueryOptions) => L[];
useLocalSubscription: (query: Exp, options?: MinilinksQueryOptions) => L[];
useLocalId: (start: DeepClientStartItem | QueryLink, ...path: DeepClientPathItem[]) => Id | void;
useLocalApply(data: any, name: string): any;
useSearch: typeof useSearch;
useCan: typeof useCan;
Subscription: typeof Subscription;
Query: typeof Query;
useDeep: typeof useDeep;
DeepProvider: typeof DeepProvider;
DeepContext: typeof DeepContext;
Traveler(links: Link<Id>[]): NativeTraveler;
Packager(): Packager<L>;
Packages(): Packages;
eval: (options: {
linkId?: Id;
handlerId?: Id;
value?: string;
context?: Id[];
input?: any;
}) => Promise<{
error?: any;
data?: any;
}>;
isId(id: any): boolean;
isLink(link: any): boolean;
get(...id: Id[]): MinilinksLink<Id> | undefined;
getRemote(...id: Id[]): Promise<MinilinksLink<Id> | undefined>;
search(value: string, options: DeepSearchOptions): Promise<DeepClientResult<L[] | number>>;
searchQuery(value: string, options: {
db: boolean;
regexp: boolean;
query: boolean;
values: boolean;
contains: boolean;
sort: boolean;
}): Exp;
emitter: EventEmitter;
url: (target: 'deeplinks' | 'gql') => string;
}
export interface DeepClientAuthResult {
linkId?: Id;
token?: string;
error?: any;
}
export interface DeepClientGuestOptions {
relogin?: boolean;
}
export interface DeepClientJWTOptions {
linkId?: Id;
token?: string;
relogin?: boolean;
}
export type SelectTable = 'links' | 'numbers' | 'strings' | 'objects' | 'can' | 'selectors' | 'tree' | 'handlers';
export type InsertTable = 'links' | 'numbers' | 'strings' | 'objects';
export type UpdateTable = 'links' | 'numbers' | 'strings' | 'objects' | 'can' | 'selectors' | 'tree' | 'handlers';
export type DeleteTable = 'links' | 'numbers' | 'strings' | 'objects' | 'can' | 'selectors' | 'tree' | 'handlers';
export type OperationType = 'select' | 'insert' | 'update' | 'delete';
export type SerialOperationType = 'insert' | 'update' | 'delete';
export type Table<TOperationType extends OperationType = OperationType> = TOperationType extends 'select' ? SelectTable : TOperationType extends 'insert' ? InsertTable : TOperationType extends 'update' ? UpdateTable : TOperationType extends 'delete' ? DeleteTable : never;
export type ValueForTable<TTable extends Table> = TTable extends 'numbers' ? MutationInputValue<number> : TTable extends 'strings' ? MutationInputValue<string> : TTable extends 'objects' ? MutationInputValue<any> : MutationInputLink;
export type ExpForTable<TTable extends Table> = TTable extends 'numbers' ? BoolExpValue<number> : TTable extends 'strings' ? BoolExpValue<string> : TTable extends 'objects' ? BoolExpValue<object> : TTable extends 'can' ? BoolExpCan : TTable extends 'selectors' ? BoolExpSelector : TTable extends 'tree' ? BoolExpTree : TTable extends 'handlers' ? BoolExpHandler : QueryLink;
export type SerialOperationDetails<TSerialOperationType extends SerialOperationType, TTable extends Table<TSerialOperationType>> = TSerialOperationType extends 'insert' ? {
objects: ValueForTable<TTable> | ValueForTable<TTable>[];
} : TSerialOperationType extends 'update' ? {
exp: ExpForTable<TTable> | number | number[];
value: ValueForTable<TTable>;
} : TSerialOperationType extends 'delete' ? {
exp: ExpForTable<TTable> | number | number[];
} : never;
export type SerialOperation<TSerialOperationType extends SerialOperationType = SerialOperationType, TTable extends Table<TSerialOperationType> = Table<TSerialOperationType>> = {
type: TSerialOperationType;
table: TTable;
} & SerialOperationDetails<TSerialOperationType, TTable>;
export type DeepSerialOperation = SerialOperation<SerialOperationType, Table<SerialOperationType>>;
export type AsyncSerialParams = {
operations: Array<DeepSerialOperation>;
name?: string;
returning?: string;
silent?: boolean;
};
export declare function addIdsToRelationsIfSimple(exp: any, key: any, env: any): any;
export declare function checkAndFillShorts(obj: any, table: any, containerId: any, Contain: any, field?: string): void;
export declare function convertDeepInsertToMinilinksApplyAndPatchVirtualIds(deep: any, objects: any, table: any, result: {
id?: number;
from_id?: number;
to_id?: number;
type_id?: number;
value?: any;
}[], errors: string[], patch?: any): {
objects: any;
levelIds: any[];
};
export declare function convertDeepUpdateToMinilinksApply(ml: any, _exp: any, _set: any, table: any, toUpdate?: {
id?: number;
from_id?: number;
to_id?: number;
type_id?: number;
value?: any;
}[]): void;
export declare function convertDeepDeleteToMinilinksApply(ml: any, _exp: any, table: any, toDelete?: number[], toUpdate?: {
id?: number;
from_id?: number;
to_id?: number;
type_id?: number;
value?: any;
}[]): void;
export declare class DeepClient<L extends Link<Id> = Link<Id>> implements DeepClientInstance<L> {
static resolveDependency?: (path: string) => Promise<any>;
useDeep: typeof useDeep;
DeepProvider: typeof DeepProvider;
DeepContext: React.Context<DeepClient<Link<Id>>>;
namespace?: string;
linkId?: Id;
token?: string;
secret?: string;
ssl?: boolean;
ws?: boolean;
handleAuth?: (linkId?: Id, token?: string) => any;
handleOperation?: (operation: string, query?: any, value?: any, options?: any) => any;
deep: DeepClientInstance<L>;
DeepClient: typeof DeepClient;
gql: typeof gql;
client: IApolloClient<any>;
apolloClient: IApolloClient<any>;
minilinks: MinilinksResult<L>;
ml: MinilinksResult<L>;
table?: string;
returning?: string;
selectReturning?: string;
linksSelectReturning?: string;
selectorsSelectReturning?: string;
canSelectReturning?: string;
treeSelectReturning?: string;
valuesSelectReturning?: string;
filesSelectReturning?: string;
handlersSelectReturning?: string;
insertReturning?: string;
updateReturning?: string;
deleteReturning?: string;
defaultSelectName?: string;
defaultInsertName?: string;
defaultUpdateName?: string;
defaultDeleteName?: string;
silent: boolean;
unsafe?: any;
useId: typeof useDeepId;
useDeepId: typeof useDeepId;
useLink: typeof useLink;
useLinks: typeof useLinks;
useSubscription: typeof useDeepSubscription;
useDeepSubscription: typeof useDeepSubscription;
useQuery: typeof useDeepQuery;
useDeepQuery: typeof useDeepQuery;
useMinilinksQuery: (query: Exp, options?: MinilinksQueryOptions) => L[];
useMinilinksSubscription: (query: Exp, options?: MinilinksQueryOptions) => L[];
useMinilinksId: (start: DeepClientStartItem | QueryLink, ...path: DeepClientPathItem[]) => Id | void;
useMinilinksApply: (data: any, name: string) => {
errors?: MinilinkError[];
anomalies?: MinilinkError[];
data: L[];
};
useLocalQuery: (query: Exp, options?: MinilinksQueryOptions) => L[];
useLocalSubscription: (query: Exp, options?: MinilinksQueryOptions) => L[];
useLocalId: (start: DeepClientStartItem | QueryLink, ...path: DeepClientPathItem[]) => Id | void;
useLocalApply: (data: any, name: string) => {
errors?: MinilinkError[];
anomalies?: MinilinkError[];
data: L[];
};
useSearch: typeof useSearch;
useCan: typeof useCan;
Subscription: typeof Subscription;
Query: typeof Query;
local?: boolean;
remote?: boolean;
unvertualizeId: (id: Id) => Id;
_silent(options?: Partial<{
silent?: boolean;
}>): boolean;
emitter: EventEmitter;
constructor(options: DeepClientOptions<L>);
_generateHooks(deep: any): void;
stringify(any?: any): string;
serializeQuery(exp: any, env?: string): any;
serializeWhere(exp: any, env?: string): any;
_generateQuery<TTable extends 'links' | 'numbers' | 'strings' | 'objects' | 'can' | 'selectors' | 'tree' | 'handlers'>(exp: Exp<TTable>, options: Options<TTable>): {
query: import("./gql/query.js").IGenerateQueryResult;
queryData: import("./gql/query.js").IGenerateQueryDataBuilder;
};
_generateResult<TTable extends 'links' | 'numbers' | 'strings' | 'objects' | 'can' | 'selectors' | 'tree' | 'handlers'>(exp: Exp<TTable>, options: Options<TTable>, data: any): any[] | Promise<any[]>;
one(exp: any): Promise<any>;
select<TTable extends 'links' | 'numbers' | 'strings' | 'objects' | 'can' | 'selectors' | 'tree' | 'handlers', LL = L>(exp: Exp<TTable>, options?: ReadOptions<TTable>): Promise<DeepClientResult<LL[]>>;
subscribe<TTable extends 'links' | 'numbers' | 'strings' | 'objects' | 'can' | 'selectors' | 'tree' | 'handlers', LL = L>(exp: Exp<TTable>, options?: ReadOptions<TTable>): Observable<DeepClientResult<LL[] | number>>;
insert<TTable extends 'links' | 'numbers' | 'strings' | 'objects', LL = L>(objects: InsertObjects<TTable>, options?: WriteOptions<TTable>): Promise<DeepClientResult<{
id: any;
}[]>>;
update<TTable extends 'links' | 'numbers' | 'strings' | 'objects'>(exp: Exp<TTable> | Id, value: UpdateValue<TTable>, options?: WriteOptions<TTable>): Promise<DeepClientResult<{
id: any;
}[]>>;
delete<TTable extends 'links' | 'numbers' | 'strings' | 'objects'>(exp: Exp<TTable> | Id, options?: WriteOptions<TTable>): Promise<DeepClientResult<{
id: any;
}[]>>;
serial(options: AsyncSerialParams): Promise<DeepClientResult<{
id: Id;
}[]>>;
reserve<LL = L>(count: number): Promise<Id[]>;
await(id: Id, options?: {
results: boolean;
}): Promise<any>;
value(id: Id, value?: string | number | Object | Blob): Promise<any>;
id(start: DeepClientStartItem | QueryLink, ...path: DeepClientPathItem[]): Promise<number>;
ids(...paths: Array<[DeepClientStartItem, ...DeepClientPathItem[]]>): Promise<any>;
idLocal(start: DeepClientStartItem, ...path: DeepClientPathItem[]): Id;
guest(options?: DeepClientGuestOptions): Promise<DeepClientAuthResult>;
jwt(options: DeepClientJWTOptions): Promise<DeepClientAuthResult>;
whoami(): Promise<number | undefined>;
login(options: DeepClientJWTOptions): Promise<DeepClientAuthResult>;
logout(): Promise<DeepClientAuthResult>;
can(objectIds: null | Id | Id[], subjectIds: null | Id | Id[], actionIds: null | Id | Id[], userIds?: Id | Id[]): Promise<boolean>;
symbol(input: Link<Id> | Id): Promise<string | undefined>;
symbolLocal(input: Link<Id> | Id): string | undefined;
name(input: Link<Id> | Id): Promise<string | undefined>;
nameLocal(input: Link<Id> | Id): string | undefined;
import(path: string): Promise<any>;
Traveler(links: Link<Id>[]): NativeTraveler;
Packager(): Packager<L>;
Packages(): Packages;
_findHandler({ handlerId, context, execution_provider_id, isolation_provider_id, }: {
handlerId?: Id;
context?: Id[];
execution_provider_id?: number;
isolation_provider_id?: number;
}): Promise<void | Handler>;
_queryTypesNamesSymbols(): {
return: {
_contain: {
relation: string;
type_id: Id;
};
_symbol: {
relation: string;
type_id: Id;
};
_type: {
relation: string;
return: {
_contain: {
relation: string;
type_id: Id;
};
_symbol: {
relation: string;
type_id: Id;
};
};
};
};
};
eval({ linkId, handlerId, value, context, input, }: {
linkId?: Id;
value?: string;
handlerId?: Id;
context?: Id[];
input?: any;
}): Promise<{
error?: any;
data?: any;
}>;
isId(id: any): boolean;
isLink(link: any): boolean;
get(...id: Id[]): MinilinksLink<Id> | undefined;
getRemote(...id: Id[]): Promise<MinilinksLink<Id> | undefined>;
search(value: string, options?: DeepSearchOptions): Promise<any>;
searchQuery(value: any, options: any): any;
url(target: 'deeplinks' | 'gql' | Id): any;
}
export declare const JWT: import("graphql/language/ast.js").DocumentNode;
export declare const WHOISME: import("graphql/language/ast.js").DocumentNode;
export declare const GUEST: import("graphql/language/ast.js").DocumentNode;
export declare function useAuthNode(): [Id, (value: Id | import("@deep-foundation/store/store.js").IUseStoreSetHandler<Id>) => any, () => any, boolean];
export type INamespaces = {
[name: string]: any;
};
export declare const DeepNamespaceContext: React.Context<{
all: () => INamespaces;
select: (namespace: string) => any;
insert: (namespace: string, deep: any) => void;
delete: (namespace: string) => void;
}>;
export declare const DeepNamespacesContext: React.Context<INamespaces>;
export declare function useDeepNamespaces(): INamespaces;
export declare function useDeepNamespace(namespace: any, deep: any): void;
export declare function DeepNamespaceProvider({ children }: {
children: any;
}): React.JSX.Element;
export declare const DeepContext: React.Context<DeepClient<Link<Id>>>;
export declare function useDeepGenerator(generatorOptions?: DeepClientOptions<Link<Id>>): DeepClient<Link<Id>>;
export declare function DeepProviderCore({ path, token, secret, ws, ssl, minilinks: inputMinilinks, namespace, children, }: {
path?: string;
token?: string;
secret?: string;
ws?: boolean;
ssl?: boolean;
minilinks?: MinilinkCollection;
namespace?: string;
children?: any;
}): React.JSX.Element;
export declare function prepareOptions(o: {
path: string;
token?: string;
secret?: string;
ws?: boolean;
ssl?: boolean;
}): {
path: string;
token: string;
secret: string;
ws: boolean;
ssl: boolean;
};
export declare function DeepProvider({ path, token, secret, ws, ssl, minilinks, namespace, children, }: {
path?: string;
token?: string;
secret?: string;
ws?: boolean;
ssl?: boolean;
apolloClient?: IApolloClient<any>;
minilinks?: MinilinkCollection;
namespace?: string;
children?: any;
}): React.JSX.Element;
export declare function useDeep(): DeepClient<Link<Id>>;
export declare function useTransparentState(value: any): any[];
export declare function useDebouncedInput(query: any, options: any, debounce: number | boolean): {
_q: any;
_o: any;
};
export declare function useDeepQuery<Table extends 'links' | 'numbers' | 'strings' | 'objects' | 'can' | 'selectors' | 'tree' | 'handlers', LL = Link<Id>>(query: Exp<Table>, options?: Options<Table>): {
data?: LL[];
error?: any;
loading: boolean;
refetch?: () => Promise<any>;
};
export declare function useDeepSubscription<Table extends 'links' | 'numbers' | 'strings' | 'objects' | 'can' | 'selectors' | 'tree' | 'handlers', LL = Link<Id>>(query: Exp<Table>, options?: Options<Table>): UseDeepSubscriptionResult<LL>;
export declare function sort(links: any, value: any): {
data: any[];
ids: any;
};
export declare function useSearch(value: string, options?: DeepSearchOptions): any;
export declare function useCan(objectId: null | Id | Id[], subjectId: null | Id | Id[], actionId: null | Id | Id[]): {
data: boolean | void;
loading: boolean;
refetch: () => Promise<boolean>;
};
export declare function useLink(link: Id | Link<Id>): MinilinksLink<Id>;
export declare function useLinks(...links: (Id | Link<Id>)[]): MinilinksLink<Id>[];
export interface UseDeepSubscriptionResult<LL = Link<Id>> {
data?: LL[];
error?: any;
loading: boolean;
query?: Exp;
}
export declare function useDeepId(start: DeepClientStartItem | QueryLink, ...path: DeepClientPathItem[]): {
data: Id;
loading: boolean;
error?: any;
};
export declare function _useDeepId(deep: DeepClient<Link<Id>>, start: DeepClientStartItem | QueryLink, ...path: DeepClientPathItem[]): {
data: Id;
loading: boolean;
error?: any;
};
export type Exp<TTable extends Table = 'links'> = (TTable extends 'numbers' ? BoolExpValue<number> : TTable extends 'strings' ? BoolExpValue<string> : TTable extends 'objects' ? BoolExpValue<object> : TTable extends 'can' ? BoolExpCan : TTable extends 'selectors' ? BoolExpSelector : TTable extends 'tree' ? BoolExpTree : TTable extends 'handlers' ? BoolExpHandler : QueryLink) | Id | Id[];
export type UpdateValue<TTable extends Table = 'links'> = (TTable extends 'numbers' ? MutationInputValue<number> : TTable extends 'strings' ? MutationInputValue<string> : TTable extends 'objects' ? MutationInputValue<any> : MutationInputLinkPlain);
export type InsertObjects<TTable extends Table = 'links'> = (TTable extends 'numbers' ? MutationInputValue<number> : TTable extends 'strings' ? MutationInputValue<string> : TTable extends 'objects' ? MutationInputValue<any> : MutationInputLink) | (TTable extends 'numbers' ? MutationInputValue<number> : TTable extends 'strings' ? MutationInputValue<string> : TTable extends 'objects' ? MutationInputValue<any> : MutationInputLink)[];
export type Options<TTable extends Table = 'links'> = {
table?: TTable;
tableNamePostfix?: string;
returning?: string;
variables?: any;
name?: string;
aggregate?: 'count' | 'sum' | 'avg' | 'min' | 'max';
mini?: string;
deep?: DeepClient<Link<Id>>;
subscription?: boolean;
apply?: string;
skip?: boolean;
debounce?: number | boolean;
};
export type ReadOptions<TTable extends Table = 'links'> = Options<TTable>;
export type WriteOptions<TTable extends Table = 'links'> = Options<TTable> & {
silent?: boolean;
remote?: boolean;
local?: boolean;
containerId?: Id;
};
export declare const Subscription: React.NamedExoticComponent<any>;
export declare const Query: React.NamedExoticComponent<any>;
export declare function useDeepPath(defaultValue?: string | undefined): [string, (value: string | import("@deep-foundation/store/store.js").IUseStoreSetHandler<string>) => any, () => any, boolean];
export declare function useDeepToken(defaultValue?: string | undefined): [string, (string: any) => string];
export declare function getServerSidePropsDeep(arg: any, result?: any): any;
export declare function getPath(path?: string): string;
export {};