mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
16 lines
518 B
TypeScript
16 lines
518 B
TypeScript
import StructuredSource = require('structured-source');
|
|
|
|
const src = new StructuredSource('aaa\u2028aaaa\u2029aaaaa\n');
|
|
|
|
// $ExpectType: number
|
|
src.positionToIndex({ line: 1, column: 2 });
|
|
// $ExpectType: { line: number, column: number }
|
|
src.indexToPosition(2);
|
|
// $ExpectType: { start: { line: number, column: number}, end: { line: number, column: number } }
|
|
src.rangeToLocation([0, 2]);
|
|
// $ExpectType: [ number, number ]
|
|
src.locationToRange({
|
|
start: { line: 1, column: 0 },
|
|
end: { line: 1, column: 2 }
|
|
});
|