eslint-plugin-complete
Version:
An ESLint plugin that contains useful rules.
49 lines • 1.71 kB
TypeScript
/**
* A description of the kind of list that is currently being iterated over. For example, the
* following text is a list:
*
* ```text
* 1. Apple
* 2. Banana
* 3. Pear
* ```
*/
export interface List {
kind: ListKind;
/** The size of the whitespace prior to the marker. For example, " 1. Foo" would be 2. */
numLeadingSpaces: number;
/**
* The size of the characters that make up the bullet point.
* e.g. "1. Foo" would be 3.
*/
markerSize: number;
/**
* The contents of JSDoc tag header, if any.
* e.g. "@param foo This is foo." would be "@param foo".
*/
jsDocTagName?: string;
}
export declare enum ListKind {
Hyphen = "Hyphen",
NumberParenthesis = "NumberParenthesis",
NumberPeriod = "NumberPeriod",
JSDocTag = "JSDocTag"
}
/**
* When using the `getList` function, the returned list may not be accurate if this is a line that
* is continuing from the previous line. For example:
*
* ```text
* This method will crash the game if you provide it an invalid number, such as 10000000000000000 or
* 43. (Using 0 will not cause a crash.)
* ```
*
* Here, "43. " is incorrectly interpreted as the beginning of a list. In order to work around this
* problem, use the `getAdjustedList` function instead.
*/
export declare function getAdjustedList(line: string, previousLineWasBlank: boolean, previousLineEndedInColon: boolean, insideList: List | undefined): List | undefined;
/**
* When iterating over lines of text, by default, we want to keep the existing list object, if any.
*/
export declare function reachedNewList(insideList: List | undefined, list: List | undefined): boolean;
//# sourceMappingURL=list.d.ts.map