//#region src/types.d.ts type SyntaxElement = { range: [number, number]; }; type TokenFilter = ((tokenOrComment: E) => tokenOrComment is R) | ((tokenOrComment: E) => boolean); type CursorWithSkipOptionsWithoutFilter = number | { includeComments?: false; filter?: undefined; skip?: number; }; type CursorWithSkipOptionsWithFilter = TokenFilter | { includeComments?: false; filter: TokenFilter; skip?: number; }; type CursorWithSkipOptionsWithComment = { includeComments: true; filter?: TokenFilter; skip?: number; }; type CursorWithCountOptionsWithoutFilter = number | { includeComments?: false; filter?: undefined; count?: number; }; type CursorWithCountOptionsWithFilter = TokenFilter | { includeComments?: false; filter: TokenFilter; count?: number; }; type CursorWithCountOptionsWithComment = { includeComments: true; filter?: TokenFilter; count?: number; }; //#endregion //#region src/token-store/token-store.d.ts declare const PRIVATE: unique symbol; declare class TokenStore { private readonly [PRIVATE]; constructor(params: { tokens: (Token | Comment)[]; isComment: (token: Token | Comment) => token is Comment; }); /** * Gets all tokens, including comments. */ getAllTokens(): (Token | Comment)[]; /** * Gets all comments. */ getAllComments(): Comment[]; /** * Gets the first token of the given node. */ getFirstToken(node: Node | Token): Token; /** * Gets the first token of the given node with simple options. */ getFirstToken(node: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter): Token | null; /** * Gets the first token of the given node with options. */ getFirstToken(node: Node | Token | Comment, options: CursorWithSkipOptionsWithFilter): R | null; /** * Gets the first token of the given node with options. */ getFirstToken(node: Node | Token | Comment, options: CursorWithSkipOptionsWithComment): R | null; /** * Gets the first token of the given node with complex options. */ getFirstToken(node: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter | CursorWithSkipOptionsWithFilter | CursorWithSkipOptionsWithComment): R | null; /** * Gets the first tokens of the given node. */ getFirstTokens(node: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter): Token[]; /** * Gets the first tokens of the given node. */ getFirstTokens(node: Node | Token | Comment, options: CursorWithCountOptionsWithFilter): R[]; /** * Gets the first tokens of the given node with comment options. */ getFirstTokens(node: Node | Token | Comment, options: CursorWithCountOptionsWithComment): R[]; /** * Gets the first tokens of the given node with complex options. */ getFirstTokens(node: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter | CursorWithCountOptionsWithFilter | CursorWithCountOptionsWithComment): R[]; /** * Gets the last token of the given node. */ getLastToken(node: Node | Token): Token; /** * Gets the last token of the given node with options. */ getLastToken(node: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter): Token | null; /** * Gets the last token of the given node with options. */ getLastToken(node: Node | Token | Comment, options: CursorWithSkipOptionsWithFilter): R | null; /** * Gets the last token of the given node with options. */ getLastToken(node: Node | Token | Comment, options: CursorWithSkipOptionsWithComment): R | null; /** * Gets the last token of the given node with complex options. */ getLastToken(node: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter | CursorWithSkipOptionsWithFilter | CursorWithSkipOptionsWithComment): R | null; /** * Get the last tokens of the given node. */ getLastTokens(node: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter): Token[]; /** * Get the last tokens of the given node. */ getLastTokens(node: Node | Token | Comment, options: CursorWithCountOptionsWithFilter): R[]; /** * Get the last tokens of the given node with comment options. */ getLastTokens(node: Node | Token | Comment, options: CursorWithCountOptionsWithComment): R[]; /** * Get the last tokens of the given node with complex options. */ getLastTokens(node: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter | CursorWithCountOptionsWithFilter | CursorWithCountOptionsWithComment): R[]; /** * Gets the token that follows a given node or token. */ getTokenAfter(node: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter): Token | null; /** * Gets the token that follows a given node or token. */ getTokenAfter(node: Node | Token | Comment, options?: CursorWithSkipOptionsWithFilter): R | null; /** * Gets the token that follows a given node or token with comment options. */ getTokenAfter(node: Node | Token | Comment, options: CursorWithSkipOptionsWithComment): R | null; /** * Gets the token that follows a given node or token with complex options. */ getTokenAfter(node: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter | CursorWithSkipOptionsWithFilter | CursorWithSkipOptionsWithComment): R | null; /** * Gets the `count` tokens that follows a given node or token. */ getTokensAfter(node: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter): Token[]; /** * Gets the `count` tokens that follows a given node or token. */ getTokensAfter(node: Node | Token | Comment, options: CursorWithCountOptionsWithFilter): R[]; /** * Gets the `count` tokens that follows a given node or token with comment options. */ getTokensAfter(node: Node | Token | Comment, options: CursorWithCountOptionsWithComment): R[]; /** * Gets the `count` tokens that follows a given node or token with complex options. */ getTokensAfter(node: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter | CursorWithCountOptionsWithFilter | CursorWithCountOptionsWithComment): R[]; /** * Gets the token that precedes a given node or token. */ getTokenBefore(node: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter): Token | null; /** * Gets the token that precedes a given node or token. */ getTokenBefore(node: Node | Token | Comment, options: CursorWithSkipOptionsWithFilter): R | null; /** * Gets the token that precedes a given node or token with comment options. */ getTokenBefore(node: Node | Token | Comment, options: CursorWithSkipOptionsWithComment): R | null; /** * Gets the token that precedes a given node or token with complex options. */ getTokenBefore(node: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter | CursorWithSkipOptionsWithFilter | CursorWithSkipOptionsWithComment): R | null; /** * Gets the `count` tokens that precedes a given node or token. */ getTokensBefore(node: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter): Token[]; /** * Gets the `count` tokens that precedes a given node or token. */ getTokensBefore(node: Node | Token | Comment, options: CursorWithCountOptionsWithFilter): R[]; /** * Gets the `count` tokens that precedes a given node or token with comment options. */ getTokensBefore(node: Node | Token | Comment, options: CursorWithCountOptionsWithComment): R[]; /** * Gets the `count` tokens that precedes a given node or token with complex options. */ getTokensBefore(node: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter | CursorWithCountOptionsWithFilter | CursorWithCountOptionsWithComment): R[]; /** * Gets the first token between two non-overlapping nodes. */ getFirstTokenBetween(left: Node | Token | Comment, right: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter): Token | null; /** * Gets the first token between two non-overlapping nodes. */ getFirstTokenBetween(left: Node | Token | Comment, right: Node | Token | Comment, options: CursorWithSkipOptionsWithFilter): R | null; /** * Gets the first token between two non-overlapping nodes with comment options. */ getFirstTokenBetween(left: Node | Token | Comment, right: Node | Token | Comment, options: CursorWithSkipOptionsWithComment): R | null; /** * Gets the first token between two non-overlapping nodes with complex options. */ getFirstTokenBetween(left: Node | Token | Comment, right: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter | CursorWithSkipOptionsWithFilter | CursorWithSkipOptionsWithComment): R | null; /** * Gets the first tokens between two non-overlapping nodes. */ getFirstTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter): Token[]; /** * Gets the first tokens between two non-overlapping nodes. */ getFirstTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, options: CursorWithCountOptionsWithFilter): R[]; /** * Gets the first tokens between two non-overlapping nodes with comment options. */ getFirstTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, options: CursorWithCountOptionsWithComment): R[]; /** * Gets the first tokens between two non-overlapping nodes with complex options. */ getFirstTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter | CursorWithCountOptionsWithFilter | CursorWithCountOptionsWithComment): R[]; /** * Gets the last token between two non-overlapping nodes. */ getLastTokenBetween(left: Node | Token | Comment, right: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter): Token | null; /** * Gets the last token between two non-overlapping nodes. */ getLastTokenBetween(left: Node | Token | Comment, right: Node | Token | Comment, options: CursorWithSkipOptionsWithFilter): R | null; /** * Gets the last token between two non-overlapping nodes with comment options. */ getLastTokenBetween(left: Node | Token | Comment, right: Node | Token | Comment, options: CursorWithSkipOptionsWithComment): R | null; /** * Gets the last token between two non-overlapping nodes with complex options. */ getLastTokenBetween(left: Node | Token | Comment, right: Node | Token | Comment, options?: CursorWithSkipOptionsWithoutFilter | CursorWithSkipOptionsWithFilter | CursorWithSkipOptionsWithComment): R | null; /** * Gets the last tokens between two non-overlapping nodes. */ getLastTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter): Token[]; /** * Gets the last tokens between two non-overlapping nodes. */ getLastTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, options: CursorWithCountOptionsWithFilter): R[]; /** * Gets the last tokens between two non-overlapping nodes with comment options. */ getLastTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, options: CursorWithCountOptionsWithComment): R[]; /** * Gets the last tokens between two non-overlapping nodes with complex options. */ getLastTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter | CursorWithCountOptionsWithFilter | CursorWithCountOptionsWithComment): R[]; /** * Gets all tokens that are related to the given node. */ getTokens(node: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter): Token[]; /** * Gets all tokens that are related to the given node. */ getTokens(node: Node | Token | Comment, options?: CursorWithCountOptionsWithFilter): R[]; /** * Gets all tokens that are related to the given node with comment options. */ getTokens(node: Node | Token | Comment, options: CursorWithCountOptionsWithComment): R[]; /** * Gets all tokens that are related to the given node with complex options. */ getTokens(node: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter | CursorWithCountOptionsWithFilter | CursorWithCountOptionsWithComment): R[]; /** * Gets all of the tokens between two non-overlapping nodes. */ getTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, options?: CursorWithCountOptionsWithoutFilter): Token[]; /** * Gets all of the tokens between two non-overlapping nodes. */ getTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, options?: CursorWithCountOptionsWithFilter): R[]; /** * Gets all of the tokens between two non-overlapping nodes with comment options. */ getTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, options: CursorWithCountOptionsWithComment): R[]; /** * Gets all of the tokens between two non-overlapping nodes with complex options. */ getTokensBetween(left: Node | Token | Comment, right: Node | Token | Comment, paddingOrOptions?: CursorWithCountOptionsWithoutFilter | CursorWithCountOptionsWithFilter | CursorWithCountOptionsWithComment): R[]; /** * Gets all comment tokens inside the given node or token. */ getCommentsInside(nodeOrToken: Node | Token | Comment): Comment[]; /** * Gets all comment tokens directly before the given node or token. */ getCommentsBefore(nodeOrToken: Node | Token | Comment): Comment[]; /** * Gets all comment tokens directly after the given node or token. */ getCommentsAfter(nodeOrToken: Node | Token | Comment): Comment[]; /** * Checks if there are any comment tokens between two non-overlapping nodes. */ commentsExistBetween(left: Node | Token | Comment, right: Node | Token | Comment): boolean; /** * Checks if there is whitespace between two non-overlapping nodes. */ isSpaceBetween(left: Node | Token | Comment, right: Node | Token | Comment): boolean; } //#endregion //#region src/index.d.ts declare const meta: { name: string; version: string; }; //#endregion export { type CursorWithCountOptionsWithComment, type CursorWithCountOptionsWithFilter, type CursorWithCountOptionsWithoutFilter, type CursorWithSkipOptionsWithComment, type CursorWithSkipOptionsWithFilter, type CursorWithSkipOptionsWithoutFilter, type SyntaxElement, type TokenFilter, TokenStore, meta };