n8n-nodes-base
Version:
Base nodes of n8n
53 lines (48 loc) • 1.71 kB
text/typescript
/**
* DeepL Node - Version 1
* Discriminator: resource=language, operation=translate
*/
interface Credentials {
deepLApi: CredentialReference;
}
/** Translate data */
export type DeepLV1LanguageTranslateParams = {
resource: 'language';
operation: 'translate';
/**
* Input text to translate
*/
text?: string | Expression<string> | PlaceholderValue;
/**
* Language to translate to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.
*/
translateTo?: string | Expression<string>;
additionalFields?: {
/** Language to translate from. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.
*/
sourceLang?: string | Expression<string>;
/** How the translation engine should split sentences
* @default 1
*/
splitSentences?: 'nonewlines' | '0' | '1' | Expression<string>;
/** Whether the translation engine should respect the original formatting, even if it would usually correct some aspects
* @default 0
*/
preserveFormatting?: '0' | '1' | Expression<string>;
/** How formal or informal the target text should be. May not be supported with all languages.
* @default default
*/
formality?: 'more' | 'less' | 'default' | Expression<string>;
};
};
export type DeepLV1LanguageTranslateOutput = {
detected_source_language?: string;
text?: string;
};
export type DeepLV1LanguageTranslateNode = {
type: 'n8n-nodes-base.deepL';
version: 1;
credentials?: Credentials;
config: NodeConfig<DeepLV1LanguageTranslateParams>;
output?: Items<DeepLV1LanguageTranslateOutput>;
};