UNPKG

alinea

Version:
29 lines (28 loc) 1.12 kB
import type { Workspace } from 'alinea/types'; import type { Config } from './Config.js'; import { Expr } from './Expr.js'; import type { Field } from './Field.js'; import { type HasRoot, type HasWorkspace } from './Internal.js'; import type { Page } from './Page.js'; import type { Root } from './Root.js'; import type { Type } from './Type.js'; export type Entity = Workspace | Root | Type | Field | Expr | Page; export declare const ScopeKey: { workspace(workspace: string): string; root(workspace: string, root: string): string; page(workspace: string, root: string, page: string): string; type(type: string): string; field(type: string, field: string): string; entry(entryId: string): string; }; export declare class Scope { #private; constructor(config: Config); workspaceOf(root: HasRoot): HasWorkspace; keyOf(entity: Entity): string; locationOf(entity: Entity): string[] | undefined; nameOf(entity: Entity): string | undefined; stringify(input: any): string; parse<Result>(input: string): Result; } export declare function getScope(config: Config): Scope;