import { Primitive } from "@radix-ui/react-primitive"; import { ComponentPropsWithoutRef, ComponentRef, ComponentType, FC, PropsWithChildren, ReactNode } from "react"; interface ScopeRegistry { span: { methods: SpanMethods; meta: SpanMeta; }; } type ClientError = { methods: Record E>; meta: { source: ClientNames; query: Record; }; events: Record<`${E}.`, E>; }; type ClientEventsType = Record<`${K}.${string}`, unknown>; type ClientMetaType = { source: ClientNames; query: Record; }; interface ClientMethods { [key: string | symbol]: (...args: any[]) => any; } type ClientNames = keyof ClientSchemas extends (infer U) ? U : never; type ClientOutput = ClientSchemas[K]["methods"] & ClientMethods; type ClientSchemas = keyof ScopeRegistry extends never ? { "ERROR: No clients were defined": ClientError<"ERROR: No clients were defined">; } : { [K in keyof ScopeRegistry]: ValidateClient; }; type Resource = (...args: A) => ResourceElement; type ResourceElement = { readonly hook: (...args: A) => R; readonly args: Readonly; readonly key?: string | number; readonly deps?: readonly unknown[]; }; interface ScopeRegistry { [key: string]: { methods: any; meta?: any; events?: any }; } declare const SpanByIndexProvider: FC>; type SpanChildrenComponentConfig = { Span: ComponentType; }; type SpanData = { id: string; parentSpanId: string | null; name: string; type: string; status: "completed" | "failed" | "running" | "skipped"; startedAt: number; endedAt: number | null; latencyMs: number | null; }; type SpanItemState = { id: string; parentSpanId: string | null; name: string; type: string; status: "completed" | "failed" | "running" | "skipped"; startedAt: number; endedAt: number | null; latencyMs: number | null; depth: number; hasChildren: boolean; isCollapsed: boolean; }; type SpanMeta = { source: "span"; query: { index: number; } | { key: string; }; }; type SpanMethods = { getState: () => SpanState; child: (lookup: SpanMeta["query"]) => SpanMethods; toggleCollapse: () => void; }; declare namespace SpanPrimitiveChildren { type Props = { components: SpanChildrenComponentConfig; children?: never; } | { children: (value: { span: SpanState; }) => ReactNode; components?: never; }; } declare const SpanPrimitiveChildren: FC; declare namespace SpanPrimitiveCollapseToggle { type Element = ComponentRef; type Props = ComponentPropsWithoutRef; } declare const SpanPrimitiveCollapseToggle: import("react").ForwardRefExoticComponent & import("react").ButtonHTMLAttributes & { asChild?: boolean; }, "ref"> & import("react").RefAttributes>; declare namespace SpanPrimitiveIndent { type Element = ComponentRef; type Props = ComponentPropsWithoutRef & { baseIndent?: number; indentPerLevel?: number; }; } declare const SpanPrimitiveIndent: import("react").ForwardRefExoticComponent & import("react").HTMLAttributes & { asChild?: boolean; }, "ref"> & { baseIndent?: number; indentPerLevel?: number; } & import("react").RefAttributes>; declare namespace SpanPrimitiveName { type Element = ComponentRef; type Props = ComponentPropsWithoutRef; } declare const SpanPrimitiveName: import("react").ForwardRefExoticComponent & import("react").HTMLAttributes & { asChild?: boolean; }, "ref"> & import("react").RefAttributes>; declare namespace SpanPrimitiveRoot { type Element = ComponentRef; type Props = ComponentPropsWithoutRef; } declare const SpanPrimitiveRoot: import("react").ForwardRefExoticComponent & import("react").HTMLAttributes & { asChild?: boolean; }, "ref"> & import("react").RefAttributes>; declare namespace SpanPrimitiveStatusIndicator { type Element = ComponentRef; type Props = ComponentPropsWithoutRef; } declare const SpanPrimitiveStatusIndicator: import("react").ForwardRefExoticComponent & import("react").HTMLAttributes & { asChild?: boolean; }, "ref"> & import("react").RefAttributes>; declare namespace SpanPrimitiveTimeline { type Element = ComponentRef; type Props = ComponentPropsWithoutRef & { timeRange?: SpanTimelineRange | undefined; paddingEnd?: number | undefined; }; } declare const SpanPrimitiveTimeline: import("react").ForwardRefExoticComponent & import("react").HTMLAttributes & { asChild?: boolean; }, "ref"> & { timeRange?: SpanTimelineRange | undefined; paddingEnd?: number | undefined; } & import("react").RefAttributes>; declare namespace SpanPrimitiveTimelineBar { type Element = ComponentRef; type Props = ComponentPropsWithoutRef & { now?: number | undefined; timeRange?: SpanTimelineRange | undefined; }; } declare const SpanPrimitiveTimelineBar: import("react").ForwardRefExoticComponent & import("react").HTMLAttributes & { asChild?: boolean; }, "ref"> & { now?: number | undefined; timeRange?: SpanTimelineRange | undefined; } & import("react").RefAttributes>; declare namespace SpanPrimitiveTypeBadge { type Element = ComponentRef; type Props = ComponentPropsWithoutRef; } declare const SpanPrimitiveTypeBadge: import("react").ForwardRefExoticComponent & import("react").HTMLAttributes & { asChild?: boolean; }, "ref"> & import("react").RefAttributes>; declare const SpanResource: Resource, [ { spans: SpanData[]; } ]>; type SpanState = SpanItemState & { children: SpanItemState[]; timeRange: { min: number; max: number; }; }; type SpanTimelineRange = { min: number; max: number; }; type ValidateClient = ScopeRegistry[K] extends { methods: ClientMethods; } ? "meta" extends keyof ScopeRegistry[K] ? ScopeRegistry[K]["meta"] extends ClientMetaType ? "events" extends keyof ScopeRegistry[K] ? ScopeRegistry[K]["events"] extends ClientEventsType ? ScopeRegistry[K] : ClientError<`ERROR: ${K & string} has invalid events type`> : ScopeRegistry[K] : ClientError<`ERROR: ${K & string} has invalid meta type`> : "events" extends keyof ScopeRegistry[K] ? ScopeRegistry[K]["events"] extends ClientEventsType ? ScopeRegistry[K] : ClientError<`ERROR: ${K & string} has invalid events type`> : ScopeRegistry[K] : ClientError<`ERROR: ${K & string} has invalid methods type`>; declare namespace entry_root_exports { export { SpanByIndexProvider, SpanData, SpanItemState, span_d_exports as SpanPrimitive, SpanResource, SpanState }; } declare namespace span_d_exports { export { SpanPrimitiveChildren as Children, SpanPrimitiveCollapseToggle as CollapseToggle, SpanPrimitiveIndent as Indent, SpanPrimitiveName as Name, SpanPrimitiveRoot as Root, SpanTimelineRange, SpanPrimitiveStatusIndicator as StatusIndicator, SpanPrimitiveTimeline as Timeline, SpanPrimitiveTimelineBar as TimelineBar, SpanPrimitiveTypeBadge as TypeBadge }; } export { entry_root_exports as entry_root };