1
0
Fork 0
mirror of https://github.com/dawidd6/action-ansible-playbook.git synced 2024-11-27 02:27:11 +00:00
action-ansible-playbook/node_modules/yaml/dist/stringify/foldFlowLines.d.ts

35 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-10-21 14:44:44 +00:00
export declare const FOLD_FLOW = "flow";
export declare const FOLD_BLOCK = "block";
export declare const FOLD_QUOTED = "quoted";
/**
* `'block'` prevents more-indented lines from being folded;
* `'quoted'` allows for `\` escapes, including escaped newlines
*/
2024-01-17 09:08:10 +00:00
export type FoldMode = 'flow' | 'block' | 'quoted';
2022-10-21 14:44:44 +00:00
export interface FoldOptions {
/**
* Accounts for leading contents on the first line, defaulting to
* `indent.length`
*/
indentAtStart?: number;
/** Default: `80` */
lineWidth?: number;
/**
* Allow highly indented lines to stretch the line width or indent content
* from the start.
*
* Default: `20`
*/
minContentWidth?: number;
/** Called once if the text is folded */
onFold?: () => void;
/** Called once if any line of text exceeds lineWidth characters */
onOverflow?: () => void;
}
/**
* Tries to keep input at up to `lineWidth` characters, splitting only on spaces
* not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are
* terminated with `\n` and started with `indent`.
*/
export declare function foldFlowLines(text: string, indent: string, mode?: FoldMode, { indentAtStart, lineWidth, minContentWidth, onFold, onOverflow }?: FoldOptions): string;