UNPKG

@crowdin/app-project-module

Version:

Module that generates for you all common endpoints for serving standalone Crowdin App

67 lines (66 loc) 1.83 kB
import { CrowdinContextInfo, ImagePath, ModuleKey, UiModule } from '../../types'; import Crowdin from '@crowdin/crowdin-api-client'; interface Boundaries { input: Input; outputs: Output[]; } interface Input { title: string; ports: Port[]; } interface Output { title: string; port: Port; } type Port = 'customCodeFalse' | 'customCodeTrue' | 'untranslated' | 'translated' | 'approved' | 'skipped' | 'all'; export interface WorkflowStepTypeModule extends ModuleKey, ImagePath { /** * module name */ name: string; /** * module description */ description?: string; /** * settings UI module */ settingsUiModule?: UiModule; /** * Editor mode that will be used in the editor for this module */ editorMode?: EditorMode; /** * input and output boundaries for the module */ boundaries: Boundaries; /** * function to save workflow step settings */ onStepSettingsSave: ({ organizationId, projectId, stepId, workflowId, settings, context, client, }: { organizationId: number; projectId?: number; stepId: number; workflowId: number; settings: any; context: CrowdinContextInfo; client: Crowdin; }) => Promise<void>; /** * function for handling actions after a step has been deleted from the workflow */ onDeleteStep: ({ organizationId, projectId, stepId, workflowId, context, client, }: { organizationId: number; projectId?: number; stepId: number; workflowId: number; context: CrowdinContextInfo; client: Crowdin; }) => Promise<void>; } export declare enum EditorMode { comfortable = "comfortable", sideBySide = "side-by-side", multilingual = "multilingual" } export {};