interface AsukaLicenseApi {
    activate: ((input?: AsukaLicenseActivateInput) => Promise<AsukaLicenseResolutionResult>);
    canUse: ((feature: string) => boolean);
    clearCache: (() => void);
    deactivate: (() => Promise<boolean>);
    get: (() => AsukaLicenseEntitlements);
    getActivationState: (() => AsukaLicenseActivationState);
    getCatalog: (() => readonly AsukaLicenseFeatureDefinition[]);
    getEnabledFeatures: (() => string[]);
    getLimits: (() => Record<string, unknown>);
    getPlanCatalog: (() => Readonly<Record<AsukaLicensePlan, PlanCatalogEntry>>);
    getQuota: ((key: AsukaCommercialQuotaKey) => {
        key: AsukaCommercialQuotaKey;
        limit: null | number;
        reached: boolean;
        remaining: null | number;
        used: null | number;
    });
    getResolution: (() => AsukaLicenseResolutionResult);
    getStatus: (() => AsukaLicenseStatus);
    getUsage: (() => Record<string, unknown>);
    hasPlan: ((plan: "starter" | "pro" | "agency") => boolean);
    isActive: (() => boolean);
    loadPremiumRuntime: (() => Promise<void>);
    refresh: (() => Promise<AsukaLicenseResolutionResult>);
    reset: ((options?: {
        clearCache?: boolean;
    }) => Promise<AsukaLicenseResolutionResult>);
    setKey: ((key: undefined | null | string) => void);
    startAutoRefresh: (() => void);
    stopAutoRefresh: (() => void);
}

Properties

Resolve a key or token immediately and apply the result to the runtime.

canUse: ((feature: string) => boolean)

Test one premium feature gate.

clearCache: (() => void)

Clear the locally cached signed license token.

deactivate: (() => Promise<boolean>)

Deactivate the current instance through the configured HTTP backend when available.

Return the effective resolved license payload.

getActivationState: (() => AsukaLicenseActivationState)

Return the current client activation capabilities and which public input source is currently configured.

getCatalog: (() => readonly AsukaLicenseFeatureDefinition[])

Return the static feature catalog used by the built-in commercial tiers.

getEnabledFeatures: (() => string[])

Return the list of currently enabled feature keys after plan defaults are merged.

getLimits: (() => Record<string, unknown>)

Return the current commercial limits payload when present.

getPlanCatalog: (() => Readonly<Record<AsukaLicensePlan, PlanCatalogEntry>>)

Return the static Starter / Pro / Agency plan catalog used by the plugin defaults.

getQuota: ((key: AsukaCommercialQuotaKey) => {
    key: AsukaCommercialQuotaKey;
    limit: null | number;
    reached: boolean;
    remaining: null | number;
    used: null | number;
})

Return a normalized quota state for one known commercial counter.

getResolution: (() => AsukaLicenseResolutionResult)

Return the low-level resolution metadata (source, signature validity...).

getStatus: (() => AsukaLicenseStatus)

Return the current commercial status string (trial_active, active, grace, expired, revoked, invalid).

getUsage: (() => Record<string, unknown>)

Return the current commercial usage counters payload when present.

hasPlan: ((plan: "starter" | "pro" | "agency") => boolean)

Test one commercial plan level.

isActive: (() => boolean)

Return whether the current license is usable (trial_active, active, or grace when still within grace).

loadPremiumRuntime: (() => Promise<void>)

Load the lazily split premium runtime package immediately.

refresh: (() => Promise<AsukaLicenseResolutionResult>)

Re-run the configured license resolution flow.

reset: ((options?: {
    clearCache?: boolean;
}) => Promise<AsukaLicenseResolutionResult>)

Forget the current runtime input and optionally clear the signed cache, then fall back to free mode.

setKey: ((key: undefined | null | string) => void)

Store a raw key client-side for the next refresh/activation.

startAutoRefresh: (() => void)

Start the built-in license auto-refresh scheduler.

stopAutoRefresh: (() => void)

Stop the built-in license auto-refresh scheduler.