import * as SchematicJS from "@schematichq/schematic-js"; import { CheckFlagReturn, CheckPlanReturn, CompanyCreditBalance, CreditBalance, CreditBalances, CreditSpendPolicies, CreditSpendPolicy, CreditSpendPolicyKind, CreditSpendPolicyScope, CreditSpendWindow, Event, EventBody, EventBodyIdentify, EventBodyTrack, EventType, Keys, RuleType, Schematic, SchematicContext, SchematicOptions, StoragePersister, Traits, TrialStatus, UsagePeriod, WarningTier } from "@schematichq/schematic-js"; import * as i0 from "@angular/core"; import { InjectionToken } from "@angular/core"; import { Observable } from "rxjs"; type BaseSchematicConfig = Omit; type SchematicConfigWithClient = BaseSchematicConfig & { client: SchematicJS.Schematic; publishableKey?: never; }; type SchematicConfigWithKey = BaseSchematicConfig & { client?: never; publishableKey: string; }; type SchematicConfig = SchematicConfigWithClient | SchematicConfigWithKey; export declare function provideSchematic(config: SchematicConfig): import("@angular/core").EnvironmentProviders; export declare const SCHEMATIC_CLIENT: InjectionToken; /** A company's credit balance for a single credit type, plus a loading flag */ type SchematicCreditBalance = { /** The spendable balance; 0 while loading or when the company holds no balance in this credit */ balance: number; /** True while the balance is still loading and no value has arrived yet */ isLoading: boolean; }; /** The credit spend policies binding the current context, plus a loading flag */ type SchematicCreditSpendPolicies = { /** Company-scope policies first, then the user's own; empty when none bind */ policies: SchematicJS.CreditSpendPolicies; /** True while the policies are still loading and nothing has arrived yet */ isLoading: boolean; }; export declare class SchematicService { private client; private flagValueCache; private entitlementCache; private creditBalanceCache; private creditSpendPoliciesCache?; private planCache?; private isPendingCache?; getClient(): SchematicJS.Schematic; setContext(context: SchematicJS.SchematicContext): void; identify(body: SchematicJS.EventBodyIdentify): void; track(body: SchematicJS.EventBodyTrack): void; flagValue$(key: string, fallback?: boolean): Observable; entitlement$(key: string, fallback?: boolean): Observable; plan$(): Observable; /** * Observe a company's live, lease-aware credit balance for a single credit type. * * Surfaces the spendable `settled` balance, sourced from the streamed credit * balances map (keyed by credit ID). It emits as partials arrive over the * DataStream, so it stays accurate during an open lease — when the raw * `remaining` would otherwise read stale / falsely "exhausted". * * The credit ID is available on a feature's entitlement: `entitlement$(key)` * emits `creditId` for credit-based features. Pass that stream straight in: * this accepts an Observable of credit IDs as well as a plain one, switching * to the new credit as the source emits. While the ID is undefined it emits * the client's loading state and a balance of 0. */ creditBalance$(creditId: string | undefined | Observable): Observable; /** * Emits a zeroed balance that still tracks the client's loading state, for * when there is no credit ID to read (a check that has not arrived yet, or a * feature that is not credit-based). */ private noCreditBalance$; private creditBalanceFor; /** * Observe every credit spend policy binding the current context, company-scope * first. It emits as partials arrive over the DataStream, so a policy edited * or deleted in the dashboard arrives without a refetch. A window policy also * carries `consumed` and `resetsAt`, which move as credits are spent. */ creditSpendPolicies$(): Observable; isPending$(): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { type CheckFlagReturn, type CheckPlanReturn, type CompanyCreditBalance, type CreditBalance, type CreditBalances, type CreditSpendPolicies, type CreditSpendPolicy, type CreditSpendPolicyKind, type CreditSpendPolicyScope, type CreditSpendWindow, type Event, type EventBody, type EventBodyIdentify, type EventBodyTrack, type EventType, type Keys, RuleType, Schematic, type SchematicConfig, type SchematicContext, type SchematicCreditBalance, type SchematicCreditSpendPolicies, type SchematicOptions, type StoragePersister, type Traits, TrialStatus, UsagePeriod, type WarningTier };