@@ -6,33 +6,41 @@ import { sourceText, initSourceText } from './source_code.js';
66
77import type { Comment , Node , NodeOrToken , Token } from './types.ts' ;
88
9- // Options for various `SourceCode` methods e.g. `getFirstToken`.
9+ /**
10+ * Options for various `SourceCode` methods e.g. `getFirstToken`.
11+ */
1012export interface SkipOptions {
11- // Number of skipping tokens
13+ /** Number of skipping tokens */
1214 skip ?: number ;
13- // `true` to include comment tokens in the result
15+ /** `true` to include comment tokens in the result */
1416 includeComments ?: boolean ;
15- // Function to filter tokens
17+ /** Function to filter tokens */
1618 filter ?: FilterFn | null ;
1719}
1820
19- // Options for various `SourceCode` methods e.g. `getFirstTokens`.
21+ /**
22+ * Options for various `SourceCode` methods e.g. `getFirstTokens`.
23+ */
2024export interface CountOptions {
21- // Maximum number of tokens to return
25+ /** Maximum number of tokens to return */
2226 count ?: number ;
23- // `true` to include comment tokens in the result
27+ /** `true` to include comment tokens in the result */
2428 includeComments ?: boolean ;
25- // Function to filter tokens
29+ /** Function to filter tokens */
2630 filter ?: FilterFn | null ;
2731}
2832
29- // Options for various `SourceCode` methods e.g. `getTokenByRangeStart`.
33+ /**
34+ * Options for various `SourceCode` methods e.g. `getTokenByRangeStart`.
35+ */
3036export interface RangeOptions {
31- // `true` to include comment tokens in the result
37+ /** `true` to include comment tokens in the result */
3238 includeComments ?: boolean ;
3339}
3440
35- // Filter function, passed as `filter` property of `SkipOptions` and `CountOptions`.
41+ /**
42+ * Filter function, passed as `filter` property of `SkipOptions` and `CountOptions`.
43+ */
3644export type FilterFn = ( token : Token ) => boolean ;
3745
3846/**
0 commit comments