autumn-js
Version:
Autumn JS Library
39 lines (36 loc) • 1.42 kB
text/typescript
import { a as CheckParams, b as AutumnPromise, C as CheckResult, A as AttachParams, R as Result, d as CancelParams, T as TrackParams } from '../clientAttachTypes-D84PT2G0.mjs';
import { A as AutumnError } from '../error-DHbclCVh.mjs';
import { G as GetEntityParams, E as Entity } from '../entTypes-CXGgMuHO.mjs';
import { A as AllowedParams } from '../handleAllowed-B8TBAzfI.mjs';
import * as swr from 'swr';
import '../cusTypes-DT2ujoSl.mjs';
import 'zod';
declare const useEntity: (entityId: string | null, params?: GetEntityParams) => {
entity: Entity | null;
isLoading: boolean;
error: any;
refetch: swr.KeyedMutator<Entity | null>;
allowed: (params: AllowedParams) => boolean;
check: (params: CheckParams) => AutumnPromise<CheckResult>;
attach: (params: AttachParams) => Promise<Result<CheckResult | {
code: string;
message: string;
customer_id: string;
product_ids: string[];
customer_data?: any;
checkout_url?: string | undefined;
}, AutumnError>>;
cancel: (params: CancelParams) => AutumnPromise<{
customer_id: string;
success: boolean;
product_id: string;
}>;
track: (params: TrackParams) => AutumnPromise<{
code: string;
id: string;
customer_id: string;
feature_id?: string | undefined;
event_name?: string | undefined;
}>;
};
export { useEntity };