@kit-data-manager/pid-component
Version:
The PID-Component is a web component that can be used to evaluate and display FAIR Digital Objects, PIDs, ORCiDs, and possibly other identifiers in a user-friendly way. It is easily extensible to support other identifier types.
27 lines (26 loc) • 1.07 kB
TypeScript
export interface JsonNode {
key: string;
value: unknown;
path: string;
isExpandable: boolean;
isArray: boolean;
itemCount?: number;
}
export declare function sanitizeData(data: unknown): unknown;
export declare function expandNodeRecursive(data: unknown, path: string, expandedNodes: Set<string>): Set<string>;
export declare function getNodeType(value: unknown): 'array' | 'object' | 'primitive';
export declare function getNodeInfo(data: unknown, key: string, path: string): JsonNode;
export declare function formatCodeLine(line: string, isDarkMode: boolean): string;
export declare function getItemCountText(count: number): string;
export declare function getValueDisplay(value: unknown): {
display: string;
type: string;
};
export declare function parseJsonSafe(input: string | object | null | undefined): {
data: unknown;
error: string | null;
};
export declare const DEFAULT_MAX_HEIGHT = 500;
export declare const DEFAULT_LINE_HEIGHT = 24;
export declare const DEFAULT_VIEW_MODE: "tree";
export type ViewMode = 'tree' | 'code';