import { IbGib_V1 } from "@ibgib/ts-gib/dist/V1/types.mjs"; import { Gib, IbGibAddr } from "@ibgib/ts-gib/dist/types.mjs"; import { MetaspaceService } from "@ibgib/core-gib/dist/witness/space/metaspace/metaspace-types.mjs"; import { IbGibSpaceAny } from "@ibgib/core-gib/dist/witness/space/space-base-v1.mjs"; import { GibColorInfo, IbGibGlobalThisInfo } from "./types.mjs"; export declare function getTagsIbGib({ metaspace, space, }: { metaspace: MetaspaceService; space: IbGibSpaceAny | undefined; }): Promise; /** * NOTE: This was originally written only for agents and I'm generalizing it to * any "coupled" ibgib. The idea is that for local-space-specific ibgibs that * are related to domain ibgibs, but where we don't want to modify the domain * ibgib directly, we create this "coupled" ibgib. We then index it in a local * space special (index) ibgib and associate it by tjpAddr. * * Generates a consistent special name for the agent index ibGib based on the * domain ibGib's primitive ancestor's ib or the ibGibAddr's ib atom. * * RIGHT NOW I"M PRIORITIZING THE ATOM. I THINK IT ALWAYS RETURNS THE ATOM, I.E., THE FIRST SPACE-DELIMITED PIECE OF THE `ib`. * * I am doing this because the project ibgib actually forks from a comment * ibgib, so its primitive ancestor is "comment^gib". * * ## notes * * We are trying to get a special ibgib index that maps from ibgibs (the domain) * to what local agent is registered to handle that ibgib's timeline. * * Concretely, we're working on the project ibgibs and we need a way to get at * the agent that is assigned to that project. But we can't just mut8 the * project itself because this would cause issues once the project is spread out * among multiple execution contexts (similar to "remotes" in git). * * So we will have a special ibgib registered with the local space which will * act as this index that maps ibgib -> handling agent. This function helps get * the *name* of that special indexing ibgib. * * This can be driven either by the ibgib itself, via the last primitive ancestor * ibgib's address, or via the ib's atom (the first space-delimited term in the * `ib` metadata). * * So if an ancestor is [comment^gib, specialComment^gib, specialComment * abc123^ABC123.DEF456] (where the abc123 things are representative of the full * hashes 64 characters long atow since we're using sha256), then the *last* * primitive address is specialComment^gib. */ export declare function getIndexNameFromIbGib({ scope, ibGib, ibGibAddr, defaultNameIfError, }: { /** * what kind of index are we talking in general? */ scope: string; ibGib?: IbGib_V1; ibGibAddr?: IbGibAddr; /** * if truthy and an error is produced, then this will be returned. */ defaultNameIfError?: string; }): string; /** * NOTE: This was originally written only for agents and I'm generalizing it to * any "coupled" ibgib. The idea is that for local-space-specific ibgibs that * are related to domain ibgibs, but where we don't want to modify the domain * ibgib directly, we create this "coupled" ibgib. We then index it in a local * space special (index) ibgib and associate it by tjpAddr. * Retrieves the agent ibGib associated with a domain ibGib from the special agent index ibGib. * * may have to change this to require the ibgib, not give an optional * domainIbGibAddr */ export declare function getLocalCoupledIbGibForDomainIbGib({ scope, ibGib, metaspace, space, skipGetLatest, }: { scope: string; ibGib: IbGib_V1; metaspace: MetaspaceService; space: IbGibSpaceAny; /** * if true, will not call getLatest on the coupled ibgib if found. */ skipGetLatest?: boolean; }): Promise; /** * Registers a domain ibGib with its associated agent ibGib in the special agent * index ibGib. This creates or updates a mapping from the domain ibGib's TJP * address to the agent's address. * * ## intent * * we want to rel8 ibgibs but not directly change the domain ibgib. Like if we * have an ibgib that we want to collaborate on, we want a mechanism for the * local space (later local user via keystone) to have settings, agents, etc., * for that domain ibgib. But each space has its own version, like a local/user * settings vs. a workspace settings. * * So this gets/creates an index on the local space and associates the domain * with the local. * * @example * use this to couple a local agent to a domain ibgib or a local settings ibgib * to a domain ibgib, that you do not want to share with others who will have * their own versions. */ export declare function coupleDomainIbGibWithLocalIbGibViaIndex({ scope, domainIbGib, localIbGib, metaspace, space, }: { scope: string; domainIbGib: IbGib_V1; localIbGib: IbGib_V1; metaspace: MetaspaceService; space: IbGibSpaceAny; }): Promise; /** * Returns a function, that, as long as it continues to be invoked, will not * be triggered. The function will be called after it stops being called for * N milliseconds. If `immediate` is passed, trigger the function on the * leading edge, instead of the trailing. * * @param func The function to debounce. * @param wait The number of milliseconds to wait after the last call. * @param immediate If true, trigger the function on the leading edge. * @returns A debounced version of the function. */ export declare function debounce void>(func: T, wait: number, immediate?: boolean): (...args: Parameters) => void; export declare function getMaskedSecret({ secret, countToShow }: { secret: string; countToShow: number; }): string; export declare function insertAt({ newItems, index, targetArray, }: { newItems: T[]; index: number; targetArray: T[]; }): T[]; export declare function deleteAt({ targetArray, index, }: { targetArray: T[]; index: number; }): T[]; export declare function getShortenedStringWithEllipsis({ str, maxChars, }: { str: string; maxChars: number; }): string; /** * location for globals to be used across ALL ibgib apps/libs, present and future. * * NOTE: Very little should be in here, since it pertains to such a broad scope. * * ## how to use this class * * ibgib apps are expected to have a metaspace singleton, and this is expected to be */ export declare class IbGibGlobalThis_IbGib { private lc; private _metaspacesByAppId; private _globalThisObjectsByAppId; constructor(); /** * The metaspace should already be initialized. * * @throws if metaspace.initialized is falsy * * @see {@link IbGibGlobalThis_IbGib} for general instructions on how to use * this class. */ registerInitializedMetaspace({ appId, metaspace, }: { appId: string; metaspace: MetaspaceService; }): Promise; /** * sync call to a metaspace that was registered by the appId. * * @throws If no metaspace was registered with the {@link appId} * * @see {@link IbGibGlobalThis_IbGib} for general instructions on how to use * this class. */ getMetaspace({ appId }: { appId: string; }): MetaspaceService; /** * Registers an app-specific global object for global state with ibgib apps, * on the ibgib global object (atow 12/2025 this is `globalThis.ibgib`). * @see {@link IbGibGlobalThis_IbGib.getGlobalThis} * * @see {@link IbGibGlobalThis_IbGib} for general instructions on how to use * this class. */ registerGlobalThis({ appId, appGlobal }: { appId: string; appGlobal: TGlobalInfo; }): void; /** * Get the app-specific global object on globalThis.ibgib that was * (or should have been) registered by the {@link appId} * * @throws if no globalThis obj was registered with `appId` * @see {@link IbGibGlobalThis_IbGib.registerGlobalThis} * * @see {@link IbGibGlobalThis_IbGib} for general instructions on how to use * this class. */ getGlobalThis({ appId }: { appId: string; }): TGlobalInfo; } /** * */ export declare function getIbGibGlobalThis_IbGib(): IbGibGlobalThisInfo; /** * helper that waits until the global metaspace is initialized and then returns * that metaspace. * * NOTE: This does not have a max count breakout or cancellation. The metaspace * is simply integral to the website and this is not expected to fail (otherwise * the entire website is foo anyway). * * ## driving use case * * when the router tries to load a route that is based on an ibgib, the * metaspace is required. */ export declare function getGlobalMetaspace_waitIfNeeded({ delayIntervalMs }?: { delayIntervalMs: number; }): Promise; /** * builds a color schema based on the gib. * * note that the alpha drives the translucent property, but the solid color is * always built */ export declare function getDeterministicColorInfo({ ibGibAddr, gib, ibGib, translucentAlpha, }: { ibGibAddr?: IbGibAddr; gib?: Gib; ibGib?: IbGib_V1; /** * drives the translucent color. * * @default 10 */ translucentAlpha?: number; }): GibColorInfo; /** * gets the color, colorTranslucent and colorContrast */ export declare function getColorStrings(translucentAlpha: number, drivingHash: string): [string, string, string]; //# sourceMappingURL=helpers.d.mts.map