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

DTO · api-edit.ts · часть 6

Часть 6 из 6: 29 интерфейсов и 12 псевдонимов типов shell-contract — правка документа: текстовые транзакции, форматирование, таблицы, буфер обмена, история и команды меню.

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

Каталог разбит на несколько страниц: часть 1 · часть 2 · часть 3 · часть 4 · часть 5 · часть 6.

Типы на этой странице — 41

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4721

type EditorV0HomeFormattingOperation = {
kind: "createStyle";
styleId: string;
name: string;
basedOn: string;
nextStyle: string;
sourceParagraphIndex: number;
paragraphIndexes: number[];
} | {
kind: "modifyStyle";
styleId: string;
name: string;
basedOn: string;
nextStyle: string;
format: EditorV0HomeStyleFormat;
} | {
kind: "updateStyleFromSelection";
styleId: string;
sourceParagraphIndex: number;
} | {
kind: "renameStyle";
styleId: string;
newName: string;
} | {
kind: "deleteStyle";
styleId: string;
fallbackStyleId: string | null;
} | {
kind: "applyStyle";
styleId: string;
paragraphIndexes: number[];
} | {
kind: "formatParagraphs";
paragraphIndexes: number[];
format: EditorV0HomeParagraphFormat;
} | {
kind: "setDefaultTabStop";
defaultTabStopTwips: number;
} | {
kind: "clearParagraphFormatting";
paragraphIndexes: number[];
};

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4751

interface EditorV0HomeFormattingRequest {
operations: EditorV0HomeFormattingOperation[];
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4757

interface EditorV0HomeFormattingResult {
schema: "fastdoc.shell.home-formatting.v1";
applied: true;
documentPath: string;
outputPath: string;
operationCount: number;
resultKind: "applied";
writebackResultKind: "written";
changedParts: string[];
sourceUnchanged: true;
state: EditorV0HomeFormattingSnapshot;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4770

interface EditorV0ParagraphLayoutBatchCommandRequest {
commands: EditorV0ParagraphLayoutCommandRequest[];
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4775

interface EditorV0ParagraphLayoutBatchCommandResult {
applied: boolean;
outputPath: string;
paragraphIndexes: number[];
commandCount: number;
beforeTexts: string[];
afterTexts: string[];
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4784

interface EditorV0ParagraphFillCommandRequest {
paragraphIndex: number;
fillColorRgb: string;
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4791

interface EditorV0ParagraphFillCommandResult {
applied: boolean;
outputPath: string;
fillColorRgb: string;
paragraphIndex: number;
beforeTexts: string[];
afterTexts: string[];
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4800

interface EditorV0ParagraphBorderCommandRequest {
paragraphIndex: number;
borderColorRgb: string;
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4807

interface EditorV0ParagraphBorderCommandResult {
applied: boolean;
outputPath: string;
borderColorRgb: string;
paragraphIndex: number;
beforeTexts: string[];
afterTexts: string[];
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4816

interface EditorV0ParagraphSortCommandRequest {
startParagraphIndex: number;
paragraphCount: number;
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4823

interface EditorV0ParagraphSortCommandResult {
applied: boolean;
outputPath: string;
startParagraphIndex: number;
paragraphCount: number;
beforeTexts: string[];
sortedTexts: string[];
afterTexts: string[];
resultKind: "applied" | "already-sorted" | "invalid-range";
writebackResultKind: "written" | "not-requested";
}

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4835

type D36CombinedSectionStart = "next-page" | "continuous" | "even-page" | "odd-page";

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4836

type D36CombinedPaperSize = "A4" | "Letter";

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4837

type D36CombinedOrientation = "portrait" | "landscape";

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4838

type D36CombinedMarginPreset = "normal" | "narrow" | "moderate" | "wide";

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4840

interface D36CombinedSectionCommandRequest {
paragraphIndex: number;
sectionStart?: D36CombinedSectionStart;
paperSize?: D36CombinedPaperSize;
orientation?: D36CombinedOrientation;
marginPreset?: D36CombinedMarginPreset;
pageNumberStart?: number;
defaultHeaderText?: string;
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4852

interface D36CombinedSectionCommandResult {
applied: boolean;
outputPath: string;
label: string;
paragraphIndex: number;
workflowResult: Record<string, unknown>;
finalPageSetupState: Record<string, unknown> | null;
finalHeaderFooterState: Record<string, unknown> | null;
beforeTexts: string[];
afterTexts: string[];
popupWarningShown: false;
}

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4865

type D36SectionPresetVisibleWorkflowCommand = "section-preset-a4" | "section-preset-landscape" | "section-preset-first-page" | "section-preset-narrow-margins";

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4871

interface D36SectionPresetVisibleWorkflowRequest {
command: D36SectionPresetVisibleWorkflowCommand;
paragraphIndex: number;
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4878

interface D36SectionPresetVisibleWorkflowResult {
schema: "fastdoc.shell.d36-section-presets-visible-workflow.v1";
applied: boolean;
noOp: boolean;
outputPath: string;
command: D36SectionPresetVisibleWorkflowCommand;
label: string;
paragraphIndex: number;
beforeState: Record<string, unknown> | null;
afterState: Record<string, unknown> | null;
beforePagination: Record<string, unknown> | null;
afterPagination: Record<string, unknown> | null;
steps: Record<string, unknown>[];
beforeTexts: string[];
afterTexts: string[];
popupWarningShown: false;
}

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4896

type D36LineNumbersCommand = "none" | "continuous" | "restart-page" | "restart-section" | "suppress-current-paragraph";

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4899

interface D36LineNumbersContinuousRequest {
command?: D36LineNumbersCommand;
paragraphIndex: number;
paragraphIndexes?: number[];
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4907

interface D36LineNumbersContinuousResult {
schema: "fastdoc.shell.d36-line-numbers-continuous-writeback.v1";
applied: boolean;
noOp: boolean;
outputPath: string;
command: D36LineNumbersCommand;
label: string;
paragraphIndex: number;
paragraphIndexes: number[];
current: boolean;
actualSavedMode: D36LineNumbersCommand;
savedDocxTruthSource: "rust-paginate-docx-after-reopen" | "rust-model-docx-after-reopen";
beforePagination: Record<string, unknown> | null;
afterPagination: Record<string, unknown> | null;
afterModel: Record<string, unknown> | null;
writebackResult: Record<string, unknown> | null;
beforeTexts: string[];
afterTexts: string[];
popupWarningShown: false;
technicalPanelAdded: false;
wordParityClaim: false;
pixelParityClaim: false;
muscleMemoryParityClaim: false;
}

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4932

type D36HyphenationCommand = "none" | "auto";

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4934

interface D36HyphenationRequest {
command?: D36HyphenationCommand;
paragraphIndex: number;
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4941

interface D36HyphenationResult {
schema: "fastdoc.shell.d36-hyphenation-writeback.v1";
applied: boolean;
noOp: boolean;
outputPath: string;
command: D36HyphenationCommand;
label: string;
paragraphIndex: number;
current: boolean;
actualSavedMode: D36HyphenationCommand;
savedDocxTruthSource: "rust-hyphenation-state-docx-after-reopen";
afterHyphenationState: Record<string, unknown> | null;
writebackResult: Record<string, unknown> | null;
beforeTexts: string[];
afterTexts: string[];
popupWarningShown: false;
technicalPanelAdded: false;
wordParityClaim: false;
pixelParityClaim: false;
muscleMemoryParityClaim: false;
}

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4963

type D36HeaderFooterEditModeStoryKind = "header" | "footer";

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4965

type D36HeaderFooterEditModeStoryVariant = "default" | "first" | "even";

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4967

interface D36HeaderFooterEditModeSaveRequest {
storyKind: D36HeaderFooterEditModeStoryKind;
storyVariant?: D36HeaderFooterEditModeStoryVariant;
text: string;
paragraphIndex: number;
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:4976

interface D36HeaderFooterEditModeSaveResult {
schema: "fastdoc.shell.d36-header-footer-edit-mode-save.v1";
applied: boolean;
noOp: boolean;
outputPath: string;
storyKind: D36HeaderFooterEditModeStoryKind;
operationKind: "set-default-header-text" | "edit-default-header-text" | "set-default-footer-text" | "edit-default-footer-text" | "set-first-header-text" | "edit-first-header-text" | "set-first-footer-text" | "edit-first-footer-text" | "set-even-header-text" | "edit-even-header-text" | "set-even-footer-text" | "edit-even-footer-text";
label: string;
paragraphIndex: number;
beforeHeaderFooterState: Record<string, unknown> | null;
afterHeaderFooterState: Record<string, unknown> | null;
beforePagination: Record<string, unknown> | null;
afterPagination: Record<string, unknown> | null;
writebackResult: Record<string, unknown> | null;
beforeTexts: string[];
afterTexts: string[];
popupWarningShown: false;
technicalPanelAdded: false;
wordParityClaim: false;
pixelParityClaim: false;
muscleMemoryParityClaim: false;
}

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:5011

type D36HeaderFooterRemoveOperationKind = "remove-default-header" | "remove-default-footer";

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:5013

interface D36HeaderFooterRemoveRequest {
storyKind: D36HeaderFooterEditModeStoryKind;
paragraphIndex: number;
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:5020

interface D36HeaderFooterRemoveResult {
schema: "fastdoc.shell.d36-header-footer-remove.v1";
applied: boolean;
noOp: boolean;
outputPath: string;
storyKind: D36HeaderFooterEditModeStoryKind;
operationKind: D36HeaderFooterRemoveOperationKind;
label: string;
paragraphIndex: number;
beforeHeaderFooterState: Record<string, unknown> | null;
afterHeaderFooterState: Record<string, unknown> | null;
beforePagination: Record<string, unknown> | null;
afterPagination: Record<string, unknown> | null;
writebackResult: Record<string, unknown> | null;
beforeTexts: string[];
afterTexts: string[];
popupWarningShown: false;
technicalPanelAdded: false;
wordParityClaim: false;
pixelParityClaim: false;
muscleMemoryParityClaim: false;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:5043

interface BoundedLiveTextInsertResult {
applied: boolean;
versionHistoryOwnership?: import("../version-store.js").SaveAsOwnershipCommitReceipt;
outputPath: string;
paragraphIndex: number;
insertedText: string;
deletedCount?: number;
nextCaretSlotIndex: number;
beforeText: string | null;
afterText: string | null;
afterTexts?: string[] | null;
canonicalOwnerAfter?: {
documentId: string;
sessionId: string;
acceptedRevision: number;
selectionRevision: number;
};
persistentReceipt?: import("../editing-session-contract.js").AcceptedEditTerminal;
persistentCheckpoint?: {
schema: "fastdoc.persistent-save-checkpoint-receipt.v1";
sessionId: string;
documentId: string;
requestId: string;
acceptedRevision: number;
publishedRevision: number;
publishedModelHash: string;
targetHashBefore: string | null;
targetHash: string;
targetIdentity: import("../version-store.js").PublishedTargetIdentity;
terminalResult: "published" | "unchanged";
physicalDocxWrites: 0 | 1;
versionHistoryOwnership: import("../version-store.js").SaveAsOwnershipCommitReceipt | null;
};
inheritedStyle: {
fontFamilyName: string | null;
fontSizeHalfPoints: number | null;
fontBold: boolean | null;
fontItalic: boolean | null;
fontColorRgb: string | null;
fontUnderline: string | null;
};
}

TypeAliasDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:5086

type BoundedLiveTextMutationResult = Omit<BoundedLiveTextInsertResult, "afterText"> & {
afterText: string;
};

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:5093

interface EditorV0EditingReplaceFirstRequest {
paragraphIndex: number;
findText: string;
replaceText: string;
offset?: number | null;
deleteCount?: number | null;
matchedText?: string | null;
matchCountBefore?: number | null;
matchCase?: boolean;
wholeWord?: boolean;
storyAware?: boolean;
sourceStory?: "body" | "table" | "header" | "footer" | "footnote" | "endnote" | "comment";
sourcePartName?: string | null;
sourcePartMatchIndex?: number | null;
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:5111

interface EditorV0EditingReplaceFirstResult {
schema: "fastdoc.shell.editor-v0-editing-replace-first-command.v1";
applied: boolean;
outputPath: string;
paragraphIndex: number;
findText: string;
replaceText: string;
beforeTexts: string[];
afterTexts: string[];
resultKind: "applied" | "not-found" | "unsupported-document" | "no-current-document" | "blocked-protected";
writebackResultKind: "written" | "not-requested" | "blocked";
matchCountBefore: number;
matchCountAfter: number;
offset?: number | null;
deleteCount?: number | null;
matchedText?: string | null;
matchCase?: boolean;
wholeWord?: boolean;
operationKind?: string;
deleteResultKind?: string | null;
insertResultKind?: string | null;
reopenedDocumentPath: string | null;
popupWarningShown: false;
technicalPanelAdded: false;
wordParityClaim: false;
pixelParityClaim: false;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:5139

interface EditorV0EditingReplaceAllRequest {
findText: string;
replaceText: string;
matchCountBefore?: number | null;
matchCase?: boolean;
wholeWord?: boolean;
storyAware?: boolean;
outputPath?: string | null;
reopenAfterWrite?: boolean;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:5150

interface EditorV0EditingReplaceAllSemanticRange {
offset: number;
deleteCount: number;
matchedText: string;
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:5156

interface EditorV0EditingReplaceAllParagraphResult {
paragraphIndex: number;
matchCountBefore: number;
remainingFindMatchCount: number;
replacementMatchCountAfter: number;
beforeText: string;
afterText: string;
resultKind: string;
writebackResultKind: string;
normalizationDetail: string | null;
operationKind?: string;
rangeCount?: number;
ranges?: EditorV0EditingReplaceAllSemanticRange[];
}

InterfaceDeclaration · apps/fastdoc-shell/src/shell-contract/api-edit.ts:5171

interface EditorV0EditingReplaceAllResult {
schema: "fastdoc.shell.editor-v0-editing-replace-all-command.v1";
applied: boolean;
outputPath: string;
paragraphIndexes: number[];
findText: string;
replaceText: string;
beforeTexts: string[];
afterTexts: string[];
resultKind: "applied" | "not-found" | "unsupported-document" | "no-current-document" | "blocked-protected";
writebackResultKind: "written" | "not-requested" | "blocked";
matchCountBefore: number;
matchCountAfter: number;
remainingFindMatchCount: number;
replacementMatchCountAfter: number;
paragraphResults: EditorV0EditingReplaceAllParagraphResult[];
matchCase?: boolean;
wholeWord?: boolean;
operationKind?: string;
rangeCount?: number;
rangeWritebackStepCount?: number;
rangeStepResultKinds?: string[];
reopenedDocumentPath: string | null;
popupWarningShown: false;
technicalPanelAdded: false;
wordParityClaim: false;
pixelParityClaim: false;
}

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

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