Skip to content

Types & Errors

Supporting data types are listed below. Error codes describe failures, not a guarantee that every method emits every code. Permission and lifetime checks happen in the host. Preserve user input on failure; do not retry non-idempotent writes blindly. Text edit stale and save conflict are result statuses, not error codes. Imported Eidos data types belong to @eidos.space/eidos-file; DOM and ECMAScript types use their standard definitions.

Usage guide: files. API index.

Signatures, parameters and return types are generated from the SDK. Optional members are not available in every host and context.

Source

export type PluginIconDefinition = string | {
paths: string[];
} | {
src: string;
} | {
file: string;
};

Source

export type ResourceSource = {
kind: "file";
path: string;
editor?: string;
} | {
kind: "eidos-view";
path: string;
tableId: string;
viewId: string;
};

Source

export type ResourceViewInfo = {
kind: "file";
editor: string;
name: string;
type: string;
} | {
kind?: "eidos-view";
tableId: string;
tableName: string;
viewId: string;
name: string;
type: string;
};

Source

export type ViewCapability = "document" | "eidos/schema" | "eidos/table" | "eidos/config";

Source

export type FileHookEventType = "document.saved" | "file.renamed";

Source

type: FileHookEventType;
operationId: string;
source: "local" | "plugin" | "sync";
path: string;
previousPath?: string;
previousText?: string;
document: {
text: string;
version: string;
};

Related types: FileHookEventType.

Source

text?: string;
name?: string;

Source

text: string;
path: string;
signal: AbortSignal;

Source

dispose(): void;

Returns: void.

Source

export type BackgroundMessage = null | boolean | number | string | BackgroundMessage[] | {
[key: string]: BackgroundMessage;
};

Source

readonly path: string;
readonly name: string;
readonly extension: string;
readonly size: number;
readonly isDirectory: boolean;
readonly modifiedAtMs?: number;

Source

extensions?: string[];
recursive?: boolean;
includeDirectories?: boolean;

Source

export type FileMetaValue = null | string | number | boolean | FileMetaValue[] | {
[key: string]: FileMetaValue;
};

Source

export type FileMetaValues = Record<string, FileMetaValue>;

Related types: FileMetaValue.

Source

set?: FileMetaValues;
remove?: string[];

Related types: FileMetaValues.

Source

rootDirectory: string | null;
activePath: string | null;
sort: {
by: "name" | "modified" | "type";
direction: "ascending" | "descending";
};

Source

readonly path: string;
readonly name: string;
readonly baseName: string;
readonly extension: string;
readonly mimeType?: string;
readonly size: number;

Source

interface FileRef extends Partial<FileMetadata> { /* members below */ }
readonly id: string;

Related types: FileMetadata.

Source

export type ViewBinding = {
kind: "page";
route: string;
} | {
kind: "file";
file: FileRef;
location?: {
kind: "eidos-table";
tableId: string;
viewId: string;
};
};

Related types: FileRef.

Source

export type ActionBinding = {
kind: "workspace";
} | {
kind: "file";
file: FileRef;
};

Related types: FileRef.

Source

id: string;
title: string;
icon?: {
paths: string[];
};
targets: Array<"row" | "selection" | "view">;

Source

id: string;
values: Record<string, LogicalValue>;
readToken: string;

Source

format: 1 | 2 | 3;
manifest: PluginManifest;
modules: Record<string, string>;
resources?: Record<string, string>;

Related types: PluginManifest.

Source

text: string;
version: string;
encoding: "utf-8" | "utf-16le" | "utf-16be";
bom: boolean;
dirty: boolean;
conflicted: boolean;

Source

value: JsonObject | null;
version: string;

Source

fields: EidosFileFieldInfo[];
view: EidosFileViewInfo;

Source

export type TableAggregateMetric = "count" | "sum" | "average" | "min" | "max";

Source

export type TableAggregateDateInterval = "exact" | "day" | "month" | "year";

Source

groupBy?: {
fieldId: string;
dateInterval?: TableAggregateDateInterval;
};
metric: {
fieldId?: string;
op: TableAggregateMetric;
};
sort?: "label" | "value-desc" | "value-asc";

Related types: TableAggregateDateInterval, TableAggregateMetric.

Source

key: unknown;
label: string;
value: number;

Source

items: TableAggregateItem[];
totalRecords: number;

Related types: TableAggregateItem.

Source

export type SettingValue = boolean | string | number;

Source

name: string;
mimeType: string;
data: Uint8Array;

Source

export type FileExportResult = {
status: "saved" | "download-started" | "cancelled";
};

Source

export type ObserverErrorHandler = (error: {
code: string;
message: string;
}) => void;

Source

export type PluginErrorCode = "INVALID_REQUEST" | "UNSUPPORTED_API" | "PERMISSION_DENIED" | "DOCUMENT_UNAVAILABLE" | "INSTANCE_CLOSED" | "STALE_REVISION" | "ALREADY_EXISTS" | "BUSY" | "TOO_LARGE" | "IO_ERROR" | "TIMEOUT" | "CANCELLED" | "REGISTRATION_CONFLICT" | "DEPENDENCY_MISSING" | "SOURCE_INVALID";