metro-source-map
Advanced tools
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<26fabb3db2058dda9c2a6e56de4728ce>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/B64Builder.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| /** | ||
| * Efficient builder for base64 VLQ mappings strings. | ||
| * | ||
| * This class uses a buffer that is preallocated with one megabyte and is | ||
| * reallocated dynamically as needed, doubling its size. | ||
| * | ||
| * Encoding never creates any complex value types (strings, objects), and only | ||
| * writes character values to the buffer. | ||
| * | ||
| * For details about source map terminology and specification, check | ||
| * https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit | ||
| */ | ||
| declare class B64Builder { | ||
| buffer: Buffer; | ||
| pos: number; | ||
| hasSegment: boolean; | ||
| constructor(); | ||
| /** | ||
| * Adds `n` markers for generated lines to the mappings. | ||
| */ | ||
| markLines(n: number): this; | ||
| /** | ||
| * Starts a segment at the specified column offset in the current line. | ||
| */ | ||
| startSegment(column: number): this; | ||
| /** | ||
| * Appends a single number to the mappings. | ||
| */ | ||
| append(value: number): this; | ||
| /** | ||
| * Returns the string representation of the mappings. | ||
| */ | ||
| toString(): string; | ||
| _writeByte(byte: number): void; | ||
| _realloc(): void; | ||
| } | ||
| export default B64Builder; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<c1cd2317d27c079743bc7c0e0fa4b379>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/BundleBuilder.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type {IndexMap, IndexMapSection, MixedSourceMap} from './source-map'; | ||
| /** | ||
| * Builds a source-mapped bundle by concatenating strings and their | ||
| * corresponding source maps (if any). | ||
| * | ||
| * Usage: | ||
| * | ||
| * const builder = new BundleBuilder('bundle.js'); | ||
| * builder | ||
| * .append('foo\n', fooMap) | ||
| * .append('bar\n') | ||
| * // ... | ||
| * const code = builder.getCode(); | ||
| * const map = builder.getMap(); | ||
| */ | ||
| export declare class BundleBuilder { | ||
| _file: string; | ||
| _sections: Array<IndexMapSection>; | ||
| _line: number; | ||
| _column: number; | ||
| _code: string; | ||
| _afterMappedContent: boolean; | ||
| constructor(file: string); | ||
| _pushMapSection(map: MixedSourceMap): void; | ||
| _endMappedContent(): void; | ||
| append(code: string, map: null | undefined | MixedSourceMap): this; | ||
| getMap(): MixedSourceMap; | ||
| getCode(): string; | ||
| } | ||
| export declare function createIndexMap( | ||
| file: string, | ||
| sections: Array<IndexMapSection>, | ||
| ): IndexMap; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<bf83602f3e958b1e38787cb0c322993f>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/composeSourceMaps.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type {MixedSourceMap} from './source-map'; | ||
| declare function composeSourceMaps( | ||
| maps: ReadonlyArray<MixedSourceMap>, | ||
| ): MixedSourceMap; | ||
| export default composeSourceMaps; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<22565876862bd94effefabfc09cf8933>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Consumer/AbstractConsumer.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type { | ||
| GeneratedPositionLookup, | ||
| IConsumer, | ||
| IterationOrder, | ||
| Mapping, | ||
| SourcePosition, | ||
| } from './types'; | ||
| declare class AbstractConsumer implements IConsumer { | ||
| _sourceMap: {readonly file?: string}; | ||
| constructor(sourceMap: {readonly file?: string}); | ||
| originalPositionFor( | ||
| generatedPosition: GeneratedPositionLookup, | ||
| ): SourcePosition; | ||
| generatedMappings(): Iterable<Mapping>; | ||
| eachMapping( | ||
| callback: (mapping: Mapping) => unknown, | ||
| context?: unknown, | ||
| order?: IterationOrder, | ||
| ): void; | ||
| get file(): null | undefined | string; | ||
| sourceContentFor( | ||
| source: string, | ||
| nullOnMissing: true, | ||
| ): null | undefined | string; | ||
| } | ||
| export default AbstractConsumer; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<bcbe0a1f886534ee2f99a12da9c16270>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Consumer/constants.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type {Number0, Number1} from 'ob1'; | ||
| declare const FIRST_COLUMN: Number0; | ||
| declare const FIRST_LINE: Number1; | ||
| export declare type IterationOrder = symbol & {__IterationOrder__: string}; | ||
| declare const GENERATED_ORDER: IterationOrder; | ||
| declare const ORIGINAL_ORDER: IterationOrder; | ||
| export declare type LookupBias = symbol & {__LookupBias__: string}; | ||
| declare const GREATEST_LOWER_BOUND: LookupBias; | ||
| declare const LEAST_UPPER_BOUND: LookupBias; | ||
| declare const EMPTY_POSITION: Readonly<{ | ||
| source: null; | ||
| name: null; | ||
| line: null; | ||
| column: null; | ||
| }>; | ||
| declare function iterationOrderToString(x: IterationOrder): string; | ||
| declare function lookupBiasToString(x: LookupBias): string; | ||
| export { | ||
| FIRST_COLUMN, | ||
| FIRST_LINE, | ||
| GENERATED_ORDER, | ||
| ORIGINAL_ORDER, | ||
| GREATEST_LOWER_BOUND, | ||
| LEAST_UPPER_BOUND, | ||
| EMPTY_POSITION, | ||
| iterationOrderToString, | ||
| lookupBiasToString, | ||
| }; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<3628df6a457f3d3d7c15f9e248338e4e>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Consumer/createConsumer.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type {MixedSourceMap} from '../source-map'; | ||
| import type {IConsumer} from './types'; | ||
| declare function createConsumer(sourceMap: MixedSourceMap): IConsumer; | ||
| export default createConsumer; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<25b3906d78ba99d86fb91390016332ff>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Consumer/DelegatingConsumer.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type {MixedSourceMap} from '../source-map'; | ||
| import type {LookupBias} from './constants.js'; | ||
| import type { | ||
| GeneratedPositionLookup, | ||
| IConsumer, | ||
| IterationOrder, | ||
| Mapping, | ||
| SourcePosition, | ||
| } from './types'; | ||
| /** | ||
| * A source map consumer that supports both "basic" and "indexed" source maps. | ||
| * Uses `MappingsConsumer` and `SectionsConsumer` under the hood (via | ||
| * `createConsumer`). | ||
| */ | ||
| declare class DelegatingConsumer implements IConsumer { | ||
| static readonly GENERATED_ORDER: IterationOrder; | ||
| static readonly ORIGINAL_ORDER: IterationOrder; | ||
| static readonly GREATEST_LOWER_BOUND: LookupBias; | ||
| static readonly LEAST_UPPER_BOUND: LookupBias; | ||
| _rootConsumer: IConsumer; | ||
| constructor(sourceMap: MixedSourceMap); | ||
| originalPositionFor( | ||
| generatedPosition: GeneratedPositionLookup, | ||
| ): SourcePosition; | ||
| generatedMappings(): Iterable<Mapping>; | ||
| eachMapping( | ||
| callback: (mapping: Mapping) => unknown, | ||
| context?: unknown, | ||
| order?: IterationOrder, | ||
| ): void; | ||
| get file(): null | undefined | string; | ||
| sourceContentFor( | ||
| source: string, | ||
| nullOnMissing: true, | ||
| ): null | undefined | string; | ||
| } | ||
| export default DelegatingConsumer; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<62d8c1b54e47245bd0ef831be2b7049d>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Consumer/index.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import DelegatingConsumer from './DelegatingConsumer'; | ||
| declare const $$EXPORT_DEFAULT_DECLARATION$$: typeof DelegatingConsumer; | ||
| declare type $$EXPORT_DEFAULT_DECLARATION$$ = | ||
| typeof $$EXPORT_DEFAULT_DECLARATION$$; | ||
| export default $$EXPORT_DEFAULT_DECLARATION$$; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<e2a6c983e649fe98c57dec4cc2e0aa65>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Consumer/MappingsConsumer.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type {BasicSourceMap} from '../source-map'; | ||
| import type { | ||
| GeneratedPositionLookup, | ||
| IConsumer, | ||
| Mapping, | ||
| SourcePosition, | ||
| } from './types'; | ||
| import type {Number0} from 'ob1'; | ||
| import AbstractConsumer from './AbstractConsumer'; | ||
| /** | ||
| * A source map consumer that supports "basic" source maps (that have a | ||
| * `mappings` field and no sections). | ||
| */ | ||
| declare class MappingsConsumer extends AbstractConsumer implements IConsumer { | ||
| _sourceMap: BasicSourceMap; | ||
| _decodedMappings: null | undefined | ReadonlyArray<Mapping>; | ||
| _normalizedSources: null | undefined | ReadonlyArray<string>; | ||
| constructor(sourceMap: BasicSourceMap); | ||
| originalPositionFor( | ||
| generatedPosition: GeneratedPositionLookup, | ||
| ): SourcePosition; | ||
| _decodeMappings(): Generator<Mapping, void, void>; | ||
| _normalizeAndCacheSources(): ReadonlyArray<string>; | ||
| _decodeAndCacheMappings(): ReadonlyArray<Mapping>; | ||
| generatedMappings(): Iterable<Mapping>; | ||
| _indexOfSource(source: string): null | undefined | Number0; | ||
| sourceContentFor( | ||
| source: string, | ||
| nullOnMissing: true, | ||
| ): null | undefined | string; | ||
| } | ||
| export default MappingsConsumer; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<f0cb08627027adbc9cc7b4b9c8caa208>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Consumer/normalizeSourcePath.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| declare function normalizeSourcePath( | ||
| sourceInput: string, | ||
| map: {readonly sourceRoot?: null | undefined | string}, | ||
| ): string; | ||
| export default normalizeSourcePath; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<6db8c7c1cbb86a47de92e1b9565dd624>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Consumer/positionMath.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type {GeneratedOffset} from './types'; | ||
| import type {Number0, Number1} from 'ob1'; | ||
| export declare function shiftPositionByOffset< | ||
| T extends { | ||
| readonly line: null | undefined | Number1; | ||
| readonly column: null | undefined | Number0; | ||
| }, | ||
| >(pos: T, offset: GeneratedOffset): T; | ||
| export declare function subtractOffsetFromPosition< | ||
| T extends { | ||
| readonly line: null | undefined | Number1; | ||
| readonly column: null | undefined | Number0; | ||
| }, | ||
| >(pos: T, offset: GeneratedOffset): T; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<c44d93a454a950171d9456512714303b>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Consumer/search.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| export declare function greatestLowerBound<T, U>( | ||
| elements: ReadonlyArray<T>, | ||
| target: U, | ||
| comparator: ($$PARAM_0$$: U, $$PARAM_1$$: T) => number, | ||
| ): null | undefined | number; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<19e73dfc942bfc06b0a44f0488b16947>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Consumer/SectionsConsumer.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type {IndexMap} from '../source-map'; | ||
| import type { | ||
| GeneratedOffset, | ||
| GeneratedPositionLookup, | ||
| IConsumer, | ||
| Mapping, | ||
| SourcePosition, | ||
| } from './types'; | ||
| import AbstractConsumer from './AbstractConsumer'; | ||
| /** | ||
| * A source map consumer that supports "indexed" source maps (that have a | ||
| * `sections` field and no top-level mappings). | ||
| */ | ||
| declare class SectionsConsumer extends AbstractConsumer implements IConsumer { | ||
| _consumers: ReadonlyArray<[GeneratedOffset, IConsumer]>; | ||
| constructor(sourceMap: IndexMap); | ||
| originalPositionFor( | ||
| generatedPosition: GeneratedPositionLookup, | ||
| ): SourcePosition; | ||
| generatedMappings(): Iterable<Mapping>; | ||
| _consumerForPosition( | ||
| generatedPosition: GeneratedPositionLookup, | ||
| ): null | undefined | [GeneratedOffset, IConsumer]; | ||
| sourceContentFor( | ||
| source: string, | ||
| nullOnMissing: true, | ||
| ): null | undefined | string; | ||
| } | ||
| export default SectionsConsumer; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<5fbef54d757c6130889a1889f7d71255>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Consumer/types.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type {IterationOrder, LookupBias} from './constants'; | ||
| import type {Number0, Number1} from 'ob1'; | ||
| export type {IterationOrder, LookupBias}; | ||
| export type GeneratedOffset = { | ||
| readonly lines: Number0; | ||
| readonly columns: Number0; | ||
| }; | ||
| export type SourcePosition = { | ||
| source: null | undefined | string; | ||
| line: null | undefined | Number1; | ||
| column: null | undefined | Number0; | ||
| name: null | undefined | string; | ||
| }; | ||
| export type GeneratedPosition = { | ||
| readonly line: Number1; | ||
| readonly column: Number0; | ||
| }; | ||
| export type GeneratedPositionLookup = { | ||
| readonly line: null | undefined | Number1; | ||
| readonly column: null | undefined | Number0; | ||
| readonly bias?: LookupBias; | ||
| }; | ||
| export type Mapping = Readonly<{ | ||
| source: null | undefined | string; | ||
| generatedLine: Number1; | ||
| generatedColumn: Number0; | ||
| originalLine: null | undefined | Number1; | ||
| originalColumn: null | undefined | Number0; | ||
| name: null | undefined | string; | ||
| }>; | ||
| export interface IConsumer { | ||
| originalPositionFor( | ||
| generatedPosition: GeneratedPositionLookup, | ||
| ): SourcePosition; | ||
| generatedMappings(): Iterable<Mapping>; | ||
| eachMapping( | ||
| callback: (mapping: Mapping) => unknown, | ||
| context?: unknown, | ||
| order?: IterationOrder, | ||
| ): void; | ||
| get file(): null | undefined | string; | ||
| sourceContentFor( | ||
| source: string, | ||
| nullOnMissing: true, | ||
| ): null | undefined | string; | ||
| } |
| /** | ||
| * Portions Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<e31ac8f472e7aa09b837bf36083edf6c>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/encode.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| /** | ||
| * Copyright 2011 Mozilla Foundation and contributors | ||
| * Licensed under the New BSD license. See LICENSE or: | ||
| * http://opensource.org/licenses/BSD-3-Clause | ||
| * | ||
| * Based on the Base 64 VLQ implementation in Closure Compiler: | ||
| * https://git.io/vymuA | ||
| * | ||
| * Copyright 2011 The Closure Compiler Authors. All rights reserved. | ||
| * Redistribution and use in source and binary forms, with or without | ||
| * modification, are permitted provided that the following conditions are | ||
| * met: | ||
| * | ||
| * * Redistributions of source code must retain the above copyright | ||
| * notice, this list of conditions and the following disclaimer. | ||
| * * Redistributions in binary form must reproduce the above | ||
| * copyright notice, this list of conditions and the following | ||
| * disclaimer in the documentation and/or other materials provided | ||
| * with the distribution. | ||
| * * Neither the name of Google Inc. nor the names of its | ||
| * contributors may be used to endorse or promote products derived | ||
| * from this software without specific prior written permission. | ||
| * | ||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| * | ||
| * @copyright | ||
| * | ||
| * Associate this with the THIRD_PARTY_LICENCE type to ensure it isn't | ||
| * stripped by flow-api-translator. | ||
| */ | ||
| export type THIRD_PARTY_LICENSE = unknown; | ||
| /** | ||
| * Encodes a number to base64 VLQ format and appends it to the passed-in buffer | ||
| * | ||
| * DON'T USE COMPOUND OPERATORS (eg `>>>=`) ON `let`-DECLARED VARIABLES! | ||
| * V8 WILL DEOPTIMIZE THIS FUNCTION AND MAP CREATION WILL BE 25% SLOWER! | ||
| * | ||
| * DON'T ADD MORE COMMENTS TO THIS FUNCTION TO KEEP ITS LENGTH SHORT ENOUGH FOR | ||
| * V8 OPTIMIZATION! | ||
| */ | ||
| declare function encode( | ||
| value: number, | ||
| buffer: Buffer, | ||
| position: number, | ||
| ): number; | ||
| export default encode; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<6f37d9027ca5bd3db3a9752a9498ab11>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/generateFunctionMap.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type {FBSourceFunctionMap} from './source-map'; | ||
| import type {PluginObj} from '@babel/core'; | ||
| import type {Node as BabelNode} from '@babel/types'; | ||
| type Position = {line: number; column: number}; | ||
| type RangeMapping = {name: string; start: Position}; | ||
| export type Context = {filename?: null | undefined | string}; | ||
| /** | ||
| * Generate a map of source positions to function names. The names are meant to | ||
| * describe the stack frame in an error trace and may contain more contextual | ||
| * information than just the actual name of the function. | ||
| * | ||
| * The output is encoded for use in a source map. For details about the format, | ||
| * see MappingEncoder below. | ||
| */ | ||
| declare function generateFunctionMap( | ||
| ast: BabelNode, | ||
| context?: Context, | ||
| ): FBSourceFunctionMap; | ||
| /** | ||
| * Same as generateFunctionMap, but returns the raw array of mappings instead | ||
| * of encoding it for use in a source map. | ||
| * | ||
| * Lines are 1-based and columns are 0-based. | ||
| */ | ||
| declare function generateFunctionMappingsArray( | ||
| ast: BabelNode, | ||
| context?: Context, | ||
| ): ReadonlyArray<RangeMapping>; | ||
| declare function functionMapBabelPlugin(): PluginObj; | ||
| export { | ||
| functionMapBabelPlugin, | ||
| generateFunctionMap, | ||
| generateFunctionMappingsArray, | ||
| }; |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<c584261d0556139618e3485bed0b3348>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/Generator.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type { | ||
| BasicSourceMap, | ||
| FBSourceFunctionMap, | ||
| FBSourceMetadata, | ||
| } from './source-map'; | ||
| import B64Builder from './B64Builder'; | ||
| type FileFlags = Readonly<{addToIgnoreList?: boolean}>; | ||
| /** | ||
| * Generates a source map from raw mappings. | ||
| * | ||
| * Raw mappings are a set of 2, 4, or five elements: | ||
| * | ||
| * - line and column number in the generated source | ||
| * - line and column number in the original source | ||
| * - symbol name in the original source | ||
| * | ||
| * Mappings have to be passed in the order appearance in the generated source. | ||
| */ | ||
| declare class Generator { | ||
| builder: B64Builder; | ||
| last: { | ||
| generatedColumn: number; | ||
| generatedLine: number; | ||
| name: number; | ||
| source: number; | ||
| sourceColumn: number; | ||
| sourceLine: number; | ||
| }; | ||
| names: IndexedSet; | ||
| source: number; | ||
| sources: Array<string>; | ||
| sourcesContent: Array<null | undefined | string>; | ||
| x_facebook_sources: Array<null | undefined | FBSourceMetadata>; | ||
| x_google_ignoreList: Array<number>; | ||
| constructor(); | ||
| /** | ||
| * Mark the beginning of a new source file. | ||
| */ | ||
| startFile( | ||
| file: string, | ||
| code: string, | ||
| functionMap: null | undefined | FBSourceFunctionMap, | ||
| flags?: FileFlags, | ||
| ): void; | ||
| /** | ||
| * Mark the end of the current source file | ||
| */ | ||
| endFile(): void; | ||
| /** | ||
| * Adds a mapping for generated code without a corresponding source location. | ||
| */ | ||
| addSimpleMapping(generatedLine: number, generatedColumn: number): void; | ||
| /** | ||
| * Adds a mapping for generated code with a corresponding source location. | ||
| */ | ||
| addSourceMapping( | ||
| generatedLine: number, | ||
| generatedColumn: number, | ||
| sourceLine: number, | ||
| sourceColumn: number, | ||
| ): void; | ||
| /** | ||
| * Adds a mapping for code with a corresponding source location + symbol name. | ||
| */ | ||
| addNamedSourceMapping( | ||
| generatedLine: number, | ||
| generatedColumn: number, | ||
| sourceLine: number, | ||
| sourceColumn: number, | ||
| name: string, | ||
| ): void; | ||
| /** | ||
| * Return the source map as object. | ||
| */ | ||
| toMap(file?: string, options?: {excludeSource?: boolean}): BasicSourceMap; | ||
| /** | ||
| * Return the source map as string. | ||
| * | ||
| * This is ~2.5x faster than calling `JSON.stringify(generator.toMap())` | ||
| */ | ||
| toString(file?: string, options?: {excludeSource?: boolean}): string; | ||
| /** | ||
| * Determine whether we need to write the `x_facebook_sources` field. | ||
| * If the metadata is all `null`s, we can omit the field entirely. | ||
| */ | ||
| hasSourcesMetadata(): boolean; | ||
| } | ||
| export default Generator; | ||
| declare class IndexedSet { | ||
| map: Map<string, number>; | ||
| nextIndex: number; | ||
| constructor(); | ||
| indexFor(x: string): number; | ||
| items(): Array<string>; | ||
| } |
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @noformat | ||
| * @oncall react_native | ||
| * @generated SignedSource<<7303fe7149cb12d764c6106cdf4f49ee>> | ||
| * | ||
| * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js | ||
| * Original file: packages/metro-source-map/src/source-map.js | ||
| * To regenerate, run: | ||
| * js1 build metro-ts-defs (internal) OR | ||
| * yarn run build-ts-defs (OSS) | ||
| */ | ||
| import type {IConsumer} from './Consumer/types'; | ||
| import {BundleBuilder, createIndexMap} from './BundleBuilder'; | ||
| import composeSourceMaps from './composeSourceMaps'; | ||
| import Consumer from './Consumer'; | ||
| import normalizeSourcePath from './Consumer/normalizeSourcePath'; | ||
| import { | ||
| functionMapBabelPlugin, | ||
| generateFunctionMap, | ||
| } from './generateFunctionMap'; | ||
| import Generator from './Generator'; | ||
| export type {IConsumer}; | ||
| type GeneratedCodeMapping = [number, number]; | ||
| type SourceMapping = [number, number, number, number]; | ||
| type SourceMappingWithName = [number, number, number, number, string]; | ||
| export type MetroSourceMapSegmentTuple = | ||
| | SourceMappingWithName | ||
| | SourceMapping | ||
| | GeneratedCodeMapping; | ||
| export type HermesFunctionOffsets = { | ||
| [$$Key$$: number]: ReadonlyArray<number>; | ||
| }; | ||
| export type FBSourcesArray = ReadonlyArray<null | undefined | FBSourceMetadata>; | ||
| export type FBSourceMetadata = [null | undefined | FBSourceFunctionMap]; | ||
| export type FBSourceFunctionMap = { | ||
| readonly names: ReadonlyArray<string>; | ||
| readonly mappings: string; | ||
| }; | ||
| export type BabelSourceMapSegment = Readonly<{ | ||
| generated: Readonly<{column: number; line: number}>; | ||
| original?: Readonly<{column: number; line: number}>; | ||
| source?: null | undefined | string; | ||
| name?: null | undefined | string; | ||
| }>; | ||
| export type FBSegmentMap = {[id: string]: MixedSourceMap}; | ||
| export type BasicSourceMap = { | ||
| readonly file?: string; | ||
| readonly mappings: string; | ||
| readonly names: Array<string>; | ||
| readonly sourceRoot?: string; | ||
| readonly sources: Array<string>; | ||
| readonly sourcesContent?: Array<null | undefined | string>; | ||
| readonly version: number; | ||
| readonly x_facebook_offsets?: Array<number>; | ||
| readonly x_metro_module_paths?: Array<string>; | ||
| readonly x_facebook_sources?: FBSourcesArray; | ||
| readonly x_facebook_segments?: FBSegmentMap; | ||
| readonly x_hermes_function_offsets?: HermesFunctionOffsets; | ||
| readonly x_google_ignoreList?: Array<number>; | ||
| }; | ||
| export type IndexMapSection = { | ||
| map: IndexMap | BasicSourceMap; | ||
| offset: {line: number; column: number}; | ||
| }; | ||
| export type IndexMap = { | ||
| readonly file?: string; | ||
| readonly mappings?: void; | ||
| readonly sourcesContent?: void; | ||
| readonly sections: Array<IndexMapSection>; | ||
| readonly version: number; | ||
| readonly x_facebook_offsets?: Array<number>; | ||
| readonly x_metro_module_paths?: Array<string>; | ||
| readonly x_facebook_sources?: void; | ||
| readonly x_facebook_segments?: FBSegmentMap; | ||
| readonly x_hermes_function_offsets?: HermesFunctionOffsets; | ||
| readonly x_google_ignoreList?: void; | ||
| }; | ||
| export type MixedSourceMap = IndexMap | BasicSourceMap; | ||
| /** | ||
| * Creates a source map from modules with "raw mappings", i.e. an array of | ||
| * tuples with either 2, 4, or 5 elements: | ||
| * generated line, generated column, source line, source line, symbol name. | ||
| * Accepts an `offsetLines` argument in case modules' code is to be offset in | ||
| * the resulting bundle, e.g. by some prefix code. | ||
| */ | ||
| declare function fromRawMappings( | ||
| modules: ReadonlyArray<{ | ||
| readonly map: null | undefined | ReadonlyArray<MetroSourceMapSegmentTuple>; | ||
| readonly functionMap: null | undefined | FBSourceFunctionMap; | ||
| readonly path: string; | ||
| readonly source: string; | ||
| readonly code: string; | ||
| readonly isIgnored: boolean; | ||
| readonly lineCount?: number; | ||
| }>, | ||
| offsetLines?: number, | ||
| ): Generator; | ||
| declare function fromRawMappingsNonBlocking( | ||
| modules: ReadonlyArray<{ | ||
| readonly map: null | undefined | ReadonlyArray<MetroSourceMapSegmentTuple>; | ||
| readonly functionMap: null | undefined | FBSourceFunctionMap; | ||
| readonly path: string; | ||
| readonly source: string; | ||
| readonly code: string; | ||
| readonly isIgnored: boolean; | ||
| readonly lineCount?: number; | ||
| }>, | ||
| offsetLines?: number, | ||
| ): Promise<Generator>; | ||
| /** | ||
| * Transforms a standard source map object into a Raw Mappings object, to be | ||
| * used across the bundler. | ||
| */ | ||
| declare function toBabelSegments( | ||
| sourceMap: BasicSourceMap, | ||
| ): Array<BabelSourceMapSegment>; | ||
| declare function toSegmentTuple( | ||
| mapping: BabelSourceMapSegment, | ||
| ): MetroSourceMapSegmentTuple; | ||
| export { | ||
| BundleBuilder, | ||
| composeSourceMaps, | ||
| Consumer, | ||
| createIndexMap, | ||
| generateFunctionMap, | ||
| fromRawMappings, | ||
| fromRawMappingsNonBlocking, | ||
| functionMapBabelPlugin, | ||
| normalizeSourcePath, | ||
| toBabelSegments, | ||
| toSegmentTuple, | ||
| }; | ||
| /** | ||
| * Backwards-compatibility with CommonJS consumers using interopRequireDefault. | ||
| * Do not add to this list. | ||
| * | ||
| * @deprecated Default import from 'metro-source-map' is deprecated, use named exports. | ||
| */ | ||
| declare const $$EXPORT_DEFAULT_DECLARATION$$: { | ||
| BundleBuilder: typeof BundleBuilder; | ||
| composeSourceMaps: typeof composeSourceMaps; | ||
| Consumer: typeof Consumer; | ||
| createIndexMap: typeof createIndexMap; | ||
| generateFunctionMap: typeof generateFunctionMap; | ||
| fromRawMappings: typeof fromRawMappings; | ||
| fromRawMappingsNonBlocking: typeof fromRawMappingsNonBlocking; | ||
| functionMapBabelPlugin: typeof functionMapBabelPlugin; | ||
| normalizeSourcePath: typeof normalizeSourcePath; | ||
| toBabelSegments: typeof toBabelSegments; | ||
| toSegmentTuple: typeof toSegmentTuple; | ||
| }; | ||
| declare type $$EXPORT_DEFAULT_DECLARATION$$ = | ||
| typeof $$EXPORT_DEFAULT_DECLARATION$$; | ||
| export default $$EXPORT_DEFAULT_DECLARATION$$; |
+3
-3
| { | ||
| "name": "metro-source-map", | ||
| "version": "0.84.1", | ||
| "version": "0.84.2", | ||
| "description": "🚇 Source map generator for Metro.", | ||
@@ -25,5 +25,5 @@ "main": "src/source-map.js", | ||
| "invariant": "^2.2.4", | ||
| "metro-symbolicate": "0.84.1", | ||
| "metro-symbolicate": "0.84.2", | ||
| "nullthrows": "^1.1.1", | ||
| "ob1": "0.84.1", | ||
| "ob1": "0.84.2", | ||
| "source-map": "^0.5.6", | ||
@@ -30,0 +30,0 @@ "vlq": "^1.0.0" |
145585
26.93%56
47.37%2516
57.84%+ Added
+ Added
- Removed
- Removed
Updated
Updated