Перейти к содержимому
FastOffice

DTO · api-quick-parts.ts

6 интерфейсов и 5 псевдонимов типов shell-contract — быстрые блоки: галереи, режимы вставки, выбор и хранилище building blocks.

Источник: apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts.

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts:1

type ShellQuickPartGallery = "quick-parts" | "autotext";

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts:2

type ShellQuickPartInsertionMode = "content" | "paragraph" | "page";

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts:3

type ShellQuickPartStoryKind = "body" | "table-cell" | "header" | "footer" | "footnote" | "endnote" | "text-box";

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts:4

type ShellQuickPartsFieldScope = "current" | "selection" | "all";

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts:6

interface ShellQuickPartSelection {
storyKind: ShellQuickPartStoryKind;
storyIndex: number;
tableCellIndex: number | null;
blockStart: number;
blockEnd: number;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts:14

interface ShellQuickPartTarget {
storyKind: ShellQuickPartStoryKind;
storyIndex: number;
tableCellIndex: number | null;
blockIndex: number | null;
insertionMode: ShellQuickPartInsertionMode;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts:22

interface ShellQuickPartBuildingBlock {
id: string;
name: string;
gallery: ShellQuickPartGallery;
category: string;
description: string;
insertionMode: ShellQuickPartInsertionMode;
fragmentFile: string;
fragmentSha256: string;
sourceSelection: ShellQuickPartSelection;
createdAt: string;
updatedAt: string;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts:36

interface ShellQuickPartsStoreSnapshot {
schema: "fastdoc.quick-parts-store.v1";
version: 1;
revision: number;
updatedAt: string;
blocks: ShellQuickPartBuildingBlock[];
storePath: string;
recoveredFrom: "primary" | "backup" | "empty";
recoveryReason: string | null;
}

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts:47

type ShellQuickPartsDocumentOperation = {
operationKind: "insert-building-block";
blockId: string;
target: ShellQuickPartTarget;
} | {
operationKind: "update-document-properties";
properties: {
title?: string;
author?: string;
subject?: string;
company?: string;
keywords?: string;
comments?: string;
custom?: Record<string, string>;
};
} | {
operationKind: "insert-field";
field: {
instruction: string;
result?: string | null;
locked?: boolean;
target: ShellQuickPartTarget;
};
} | {
operationKind: "replace-field";
field: {
instruction: string;
result?: string | null;
locked?: boolean;
};
selection: ShellQuickPartSelection;
} | {
operationKind: "set-field-lock";
locked: boolean;
scope?: ShellQuickPartsFieldScope;
selection?: ShellQuickPartSelection | null;
updateAll?: boolean;
} | {
operationKind: "update-fields";
scope?: ShellQuickPartsFieldScope;
selection?: ShellQuickPartSelection | null;
updateAll?: boolean;
} | {
operationKind: "toggle-field-display";
showCodes: boolean;
};

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts:56

interface ShellQuickPartsDocumentResult extends Record<string, unknown> {
applied: true;
outputPath: string;
operationKind: string;
reopened: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-quick-parts.ts:63

interface FastDocQuickPartsApi {
listQuickPartsBuildingBlocks(): Promise<ShellQuickPartsStoreSnapshot>;
createQuickPartsBuildingBlock(request: {
name: string;
gallery: ShellQuickPartGallery;
category: string;
description?: string;
insertionMode: ShellQuickPartInsertionMode;
sourcePath?: string | null;
sourceSelection: ShellQuickPartSelection;
}): Promise<ShellQuickPartsStoreSnapshot>;
updateQuickPartsBuildingBlock(request: {
id: string;
expectedRevision?: number | null;
name?: string;
gallery?: ShellQuickPartGallery;
category?: string;
description?: string;
insertionMode?: ShellQuickPartInsertionMode;
}): Promise<ShellQuickPartsStoreSnapshot>;
deleteQuickPartsBuildingBlock(request: {
id: string;
expectedRevision?: number | null;
}): Promise<ShellQuickPartsStoreSnapshot>;
applyQuickPartsDocumentOperation(request: ShellQuickPartsDocumentOperation & {
sourcePath?: string | null;
reopenAfterWrite?: boolean;
}): Promise<ShellQuickPartsDocumentResult>;
}

Ассистент документации

Ответ собран из документации и может быть неточным — сверяйтесь с источниками.