import { Elb, WalkerOS, Collector, Source } from '@walkeros/core'; import { z } from '@walkeros/core/dev'; import { DestinationWeb, Walker } from '@walkeros/web-core'; /** * Browser source settings schema */ declare const SettingsSchema: z.ZodObject<{ prefix: z.ZodDefault; scope: z.ZodOptional; pageview: z.ZodDefault; elb: z.ZodDefault; name: z.ZodOptional; elbLayer: z.ZodDefault>; }, z.core.$strip>; type Scope$1 = Element | Document; type Trigger = string; interface BrowserPush> extends Elb.WalkerCommands { (event: WalkerOS.DeepPartialEvent): R; (event: 'walker init', scope: Scope$1 | Scope$1[]): R; (event: 'walker run', state?: Partial): R; (event?: unknown, data?: BrowserPushData, options?: BrowserPushOptions, context?: BrowserPushContext, nested?: WalkerOS.Entities, custom?: WalkerOS.Properties): R; } type BrowserArguments> = (event?: unknown, data?: BrowserPushData, options?: BrowserPushOptions, context?: BrowserPushContext, nested?: WalkerOS.Entities, custom?: WalkerOS.Properties) => R; type BrowserPushData = Elb.PushData | DestinationWeb.Destination | DestinationWeb.Init | Scope$1 | Array | Trigger | string | object | IArguments; type BrowserPushOptions = Trigger | string | object; type BrowserPushContext = WalkerOS.OrderedProperties | Element; type PushResult = Elb.PushResult; type Layer = Elb.Layer | IArguments; declare module '@walkeros/core' { interface SourceMap { browser: { type: 'browser'; platform: 'web'; url?: string; referrer?: string; }; } } type BaseSettings = z.infer; interface InitSettings extends Partial> { scope?: Element | Document; elbLayer?: boolean | string | Elb.Layer; } interface Settings extends Omit { scope?: Element | Document; elbLayer: boolean | string | Elb.Layer; } interface Mapping { } type Push = BrowserPush; interface Env extends Source.BaseEnv { elb: Elb.Fn; window?: Window & typeof globalThis; document?: Document; } type Types = Source.Types; type Config = Source.Config; interface Context { elb: Elb.Fn; settings: Settings; initScope?: (context: Context, settings: Settings) => void; } type ELBLayer = Array; interface ELBLayerConfig { name?: string; } type Scope = Document | Element; type index_BrowserArguments> = BrowserArguments; type index_BrowserPush> = BrowserPush; type index_BrowserPushContext = BrowserPushContext; type index_BrowserPushData = BrowserPushData; type index_BrowserPushOptions = BrowserPushOptions; type index_Config = Config; type index_Context = Context; type index_ELBLayer = ELBLayer; type index_ELBLayerConfig = ELBLayerConfig; type index_Env = Env; type index_InitSettings = InitSettings; type index_Layer = Layer; type index_Mapping = Mapping; type index_Push = Push; type index_PushResult = PushResult; type index_Scope = Scope; type index_Settings = Settings; type index_Trigger = Trigger; type index_Types = Types; declare namespace index { export type { index_BrowserArguments as BrowserArguments, index_BrowserPush as BrowserPush, index_BrowserPushContext as BrowserPushContext, index_BrowserPushData as BrowserPushData, index_BrowserPushOptions as BrowserPushOptions, index_Config as Config, index_Context as Context, index_ELBLayer as ELBLayer, index_ELBLayerConfig as ELBLayerConfig, index_Env as Env, index_InitSettings as InitSettings, index_Layer as Layer, index_Mapping as Mapping, index_Push as Push, index_PushResult as PushResult, index_Scope as Scope, index_Settings as Settings, index_Trigger as Trigger, index_Types as Types }; } declare function getElbAttributeName(prefix: string, name?: string, isProperty?: boolean): string; declare function getElbValues(prefix: string, element: Element, name: string, isProperty?: boolean): WalkerOS.Properties; declare function getAllEvents(scope: Scope, prefix?: string): Walker.Events; declare function getEvents(target: Element, trigger: string, prefix?: string): Walker.Events; declare function getGlobals(prefix?: string, scope?: Scope): WalkerOS.Properties; interface TaggerConfig { prefix?: string; } interface TaggerInstance { entity: (name: string) => TaggerInstance; data: ((key: string, value: WalkerOS.Property) => TaggerInstance) & ((data: WalkerOS.Properties) => TaggerInstance); scoped: ((key: string, value: WalkerOS.Property) => TaggerInstance) & ((scoped: WalkerOS.Properties) => TaggerInstance); action: ((trigger: string, action?: string) => TaggerInstance) & ((actions: Record) => TaggerInstance); actions: ((trigger: string, action?: string) => TaggerInstance) & ((actions: Record) => TaggerInstance); context: ((key: string, value: WalkerOS.Property) => TaggerInstance) & ((context: WalkerOS.Properties) => TaggerInstance); globals: ((key: string, value: WalkerOS.Property) => TaggerInstance) & ((globals: WalkerOS.Properties) => TaggerInstance); link: ((id: string, type: string) => TaggerInstance) & ((links: Record) => TaggerInstance); get: () => Record; } /** * Creates a new tagger instance for generating walkerOS data attributes. * * @param config The configuration for the tagger. * @returns A new tagger instance. */ declare function createTagger(config?: TaggerConfig): (entity?: string) => TaggerInstance; /** For tests only. Clears the window-scoped single-instance sentinel. */ declare function __resetInstanceCountForTests(): void; /** * Browser source implementation using environment injection. * * The factory body is side-effect-free: it constructs the Instance and * captures closure state. All eager setup (elbLayer drain, DOM listeners, * `window.elb` assignment) lives in the `init` lifecycle method, which * the collector calls after every source factory has registered. The * collector strictly gates `on()` delivery: lifecycle events are queued * in `instance.queueOn` until the source is started. */ declare const sourceBrowser: Source.Init; export { index as SourceBrowser, type TaggerConfig, type TaggerInstance, __resetInstanceCountForTests, createTagger, sourceBrowser as default, getAllEvents, getElbAttributeName, getElbValues, getEvents, getGlobals, sourceBrowser };