---
title: "Types & Errors | Eidos Docs"
description: "SDK signatures, permissions and behavior for Types & Errors."
source: "https://docs.eidos.space/plugins/api/types/"
lang: "en"
---

# 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](https://docs.eidos.space/plugins/files/). [API index](https://docs.eidos.space/plugins/api/).

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

## PluginIconDefinition

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L1)

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

## ResourceSource

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L91)

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

## ResourceViewInfo

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L94)

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

## ViewCapability

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L118)

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

## FileHookEventType

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L156)

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

## FileHookEvent

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L164)

### FileHookEvent.type

```ts
type: FileHookEventType;
```

### FileHookEvent.operationId

```ts
operationId: string;
```

### FileHookEvent.source

```ts
source: "local" | "plugin" | "sync";
```

### FileHookEvent.path

```ts
path: string;
```

### FileHookEvent.previousPath

```ts
previousPath?: string;
```

### FileHookEvent.previousText

```ts
previousText?: string;
```

### FileHookEvent.document

```ts
document: {
    text: string;
    version: string;
};
```

Related types: [FileHookEventType](https://docs.eidos.space/plugins/api/types/#filehookeventtype).

## FileHookPlan

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L173)

### FileHookPlan.text

```ts
text?: string;
```

### FileHookPlan.name

```ts
name?: string;
```

## FormatterInput

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L187)

### FormatterInput.text

```ts
text: string;
```

### FormatterInput.path

```ts
path: string;
```

### FormatterInput.signal

```ts
signal: AbortSignal;
```

## Disposable

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L214)

### Disposable.dispose

```ts
dispose(): void;
```

Returns: `void`.

## BackgroundMessage

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L234)

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

## FileStat

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L323)

### FileStat.path

```ts
readonly path: string;
```

### FileStat.name

```ts
readonly name: string;
```

### FileStat.extension

```ts
readonly extension: string;
```

### FileStat.size

```ts
readonly size: number;
```

### FileStat.isDirectory

```ts
readonly isDirectory: boolean;
```

### FileStat.modifiedAtMs

```ts
readonly modifiedAtMs?: number;
```

## FileListOptions

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L332)

### FileListOptions.extensions

```ts
extensions?: string[];
```

### FileListOptions.recursive

```ts
recursive?: boolean;
```

### FileListOptions.includeDirectories

```ts
includeDirectories?: boolean;
```

## FileMetaValue

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L380)

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

## FileMetaValues

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L387)

```ts
export type FileMetaValues = Record<string, FileMetaValue>;
```

Related types: [FileMetaValue](https://docs.eidos.space/plugins/api/types/#filemetavalue).

## FileMetaPatch

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L388)

### FileMetaPatch.set

```ts
set?: FileMetaValues;
```

### FileMetaPatch.remove

```ts
remove?: string[];
```

Related types: [FileMetaValues](https://docs.eidos.space/plugins/api/types/#filemetavalues).

## ExplorerState

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L392)

### ExplorerState.rootDirectory

```ts
rootDirectory: string | null;
```

### ExplorerState.activePath

```ts
activePath: string | null;
```

### ExplorerState.sort

```ts
sort: {
    by: "name" | "modified" | "type";
    direction: "ascending" | "descending";
};
```

## FileMetadata

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L406)

### FileMetadata.path

```ts
readonly path: string;
```

### FileMetadata.name

```ts
readonly name: string;
```

### FileMetadata.baseName

```ts
readonly baseName: string;
```

### FileMetadata.extension

```ts
readonly extension: string;
```

### FileMetadata.mimeType

```ts
readonly mimeType?: string;
```

### FileMetadata.size

```ts
readonly size: number;
```

## FileRef

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L449)

```ts
interface FileRef extends Partial<FileMetadata> { /* members below */ }
```

### FileRef.id

```ts
readonly id: string;
```

Related types: [FileMetadata](https://docs.eidos.space/plugins/api/types/#filemetadata).

## ViewBinding

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L452)

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

Related types: [FileRef](https://docs.eidos.space/plugins/api/types/#fileref).

## ActionBinding

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L482)

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

Related types: [FileRef](https://docs.eidos.space/plugins/api/types/#fileref).

## TableActionItem

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L513)

### TableActionItem.id

```ts
id: string;
```

### TableActionItem.title

```ts
title: string;
```

### TableActionItem.icon

```ts
icon?: {
    paths: string[];
};
```

### TableActionItem.targets

```ts
targets: Array<"row" | "selection" | "view">;
```

## TableActionRecord

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L520)

### TableActionRecord.id

```ts
id: string;
```

### TableActionRecord.values

```ts
values: Record<string, LogicalValue>;
```

### TableActionRecord.readToken

```ts
readToken: string;
```

## PluginPackage

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L577)

### PluginPackage.format

```ts
format: 1 | 2 | 3;
```

### PluginPackage.manifest

```ts
manifest: PluginManifest;
```

### PluginPackage.modules

```ts
modules: Record<string, string>;
```

### PluginPackage.resources

```ts
resources?: Record<string, string>;
```

Related types: [PluginManifest](https://docs.eidos.space/plugins/api/manifest/#pluginmanifest).

## TextSnapshot

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L584)

### TextSnapshot.text

```ts
text: string;
```

### TextSnapshot.version

```ts
version: string;
```

### TextSnapshot.encoding

```ts
encoding: "utf-8" | "utf-16le" | "utf-16be";
```

### TextSnapshot.bom

```ts
bom: boolean;
```

### TextSnapshot.dirty

```ts
dirty: boolean;
```

### TextSnapshot.conflicted

```ts
conflicted: boolean;
```

## EidosConfigSnapshot

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L634)

### EidosConfigSnapshot.value

```ts
value: JsonObject | null;
```

### EidosConfigSnapshot.version

```ts
version: string;
```

## EidosTableSnapshot

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L638)

### EidosTableSnapshot.fields

```ts
fields: EidosFileFieldInfo[];
```

### EidosTableSnapshot.view

```ts
view: EidosFileViewInfo;
```

## TableAggregateMetric

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L668)

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

## TableAggregateDateInterval

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L670)

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

## TableAggregateOptions

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L672)

### TableAggregateOptions.groupBy

```ts
groupBy?: {
    fieldId: string;
    dateInterval?: TableAggregateDateInterval;
};
```

### TableAggregateOptions.metric

```ts
metric: {
    fieldId?: string;
    op: TableAggregateMetric;
};
```

### TableAggregateOptions.sort

```ts
sort?: "label" | "value-desc" | "value-asc";
```

Related types: [TableAggregateDateInterval](https://docs.eidos.space/plugins/api/types/#tableaggregatedateinterval), [TableAggregateMetric](https://docs.eidos.space/plugins/api/types/#tableaggregatemetric).

## TableAggregateItem

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L684)

### TableAggregateItem.key

```ts
key: unknown;
```

### TableAggregateItem.label

```ts
label: string;
```

### TableAggregateItem.value

```ts
value: number;
```

## TableAggregateResult

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L690)

### TableAggregateResult.items

```ts
items: TableAggregateItem[];
```

### TableAggregateResult.totalRecords

```ts
totalRecords: number;
```

Related types: [TableAggregateItem](https://docs.eidos.space/plugins/api/types/#tableaggregateitem).

## SettingValue

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L695)

```ts
export type SettingValue = boolean | string | number;
```

## FileExportRequest

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L706)

### FileExportRequest.name

```ts
name: string;
```

### FileExportRequest.mimeType

```ts
mimeType: string;
```

### FileExportRequest.data

```ts
data: Uint8Array;
```

## FileExportResult

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L713)

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

## ObserverErrorHandler

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-sdk/src/index.ts#L735)

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

## PluginErrorCode

[Source](https://github.com/mayneyao/eidos/blob/dev/packages/plugin-runtime/src/errors.ts#L1)

```ts
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";
```
