{"_id":"@volar/source-map@3.0.0-alpha.0","bugs":{"url":"https://github.com/volarjs/volar.js/issues"},"dist":{"shasum":"9fd448af81d172d9fc799b77e75d00735dd330f2","tarball":"http://registry-npm.ywwl.com/@volar/source-map/download/@volar/source-map-3.0.0-alpha.0.tgz","fileCount":9,"integrity":"sha512-b3AuLTrYP/4AozjaHXPkhjo3zeMVzd38SoYcZoomyEHwDSyk4xtqNHAkSvELQaWkiIsl9of4tPFxyzuuGG5UGw==","signatures":[{"sig":"MEUCIC3oIGoRuerkQDsvXetUDKCzp2GOHyWvsEAy6XpHr0RdAiEAtJ1Fz2DIrc0jJWyiQ9JlbwfhuIZas+MjthkKZfNlgdQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQChU6p9srBTwlOU981xcnbJ+H2cgvGnMCLw9zyVlCMbaQIhAMbknqMVQnRn/+pJSvZXHkcweNe08fnEta+GcLKPBYMe"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@volar%2fsource-map@3.0.0-alpha.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16379,"size":5081,"noattachment":false,"key":"/@volar/source-map/-/@volar/source-map-3.0.0-alpha.0.tgz"},"name":"@volar/source-map","_from":"file:volar-source-map-3.0.0-alpha.0.tgz","types":"./index.d.ts","license":"MIT","version":"3.0.0-alpha.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"da7cd413-3f45-412e-afd8-85dd032be747"}},"homepage":"https://github.com/volarjs/volar.js#readme","_resolved":"/tmp/c7f556d639fa02481ad1897a8741f85b/volar-source-map-3.0.0-alpha.0.tgz","_integrity":"sha512-b3AuLTrYP/4AozjaHXPkhjo3zeMVzd38SoYcZoomyEHwDSyk4xtqNHAkSvELQaWkiIsl9of4tPFxyzuuGG5UGw==","repository":{"url":"git+https://github.com/volarjs/volar.js.git","type":"git","directory":"packages/source-map"},"_npmVersion":"11.19.1","description":"Maps positions and ranges between virtual (generated) and original (source) text, in the span map model of TypeScript 7.1: `SpanMapSegment`, `SpanMapKind`, `SpanMapFeature` and `SpanMapFidelity` have the shape and values of their counterparts in `typescri","directories":{},"maintainers":[{"name":"johnsoncodehk","email":"johnsoncodehk@gmail.com"}],"_nodeVersion":"24.22.1","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/source-map_3.0.0-alpha.0_1793303879725_0.7406422926091853"},"readme":"# @volar/source-map\n\nProvides functionality related to source maps.\n\n## API\n\n### This package exports a `SourceMap` class with the following methods:\n\nParams:\n\n- `fallbackToAnyMatch`(default: false): allow the start and end offsets to come from different mappings.\n- `filter?: (data: Data) => boolean)`(default: undefined):  according to mapping: Mapping<MyDataType>.data, filter out offsets that do not meet the custom conditions.\n\nMethods:\n\n- `toSourceRange(generatedStart: number, generatedEnd: number, fallbackToAnyMatch: boolean, filter?: (data: Data) => boolean)`: Returns all source start and end offsets for the given generated start and end offsets.\n\n- `toGeneratedRange(sourceStart: number, sourceEnd: number, fallbackToAnyMatch: boolean, filter?: (data: Data) => boolean) `: Returns all generated start and end offsets for the given source start and end offsets.\n\n- `toSourceLocation(generatedOffset: number, filter?: (data: Data) => boolean)`: Returns all source offsets for a given generated offset.\n\n- `toGeneratedLocation(sourceOffset: number, filter?: (data: Data) => boolean)`: Returns all generated offsets for a given source offset.\n\n## Data Structures\n\n### `Mapping`\n\nThe `Mapping` is a tuple that represents a mapping in the source map. It consists of the following elements:\n\n- `source`: A string representing the source file. This can be `undefined`.\n- `sourceOffsets`: Offsets in the source code.\n- `generatedOffsets`: Offsets in the generated code.\n- `data`: The data associated with this mapping. The type of this data is generic and can be specified when creating a `SourceMap` instance.\n\nHere is an example of a `Mapping`:\n\n```ts\nlet mapping: Mapping<MyDataType> = {\n    source: '.../sourceFile.ts',\n    sourceOffsets: [10],\n    generatedOffsets: [30],\n\tlengths: [10],\n    data: myData,\n};\n```\n\nIn this example, `myData` is of type `MyDataType`, which is the type specified for the SourceMap instance.\n\nRemember to replace `MyDataType` and `myData` with actual types and data that are relevant to your project.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n","publish_time":1793303879836,"_cnpm_publish_time":1793303879836,"dist-tags":{"@volar/language-core@2.0.0-alpha.12":"2.0.0-alpha.12","latest":"2.4.31","next":"3.0.0-alpha.0"}}