/** * 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<> * * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js * Original file: packages/metro/src/lib/resolveInlineModule.js * To regenerate, run: * js1 build metro-ts-defs (internal) OR * yarn run build-ts-defs (OSS) */ import type {ResolutionContext, VirtualResolution} from 'metro-resolver'; export declare const INLINE_MODULE_SPECIFIER: 'inline'; export declare type INLINE_MODULE_SPECIFIER = typeof INLINE_MODULE_SPECIFIER; /** * Resolves the `inline` pathname of Metro's own URI scheme, so that a transform * may emit a module inline in its importer: * * require('metro:inline;base64,ZXhwb3J0IGRlZmF1bHQgMQ==') * * The payload is the module's source, percent-encoded or base64-encoded as in * a `data:` URL. Unlike a `data:` URL, an inline module belongs to its importer: * the same payload in two modules is two modules, and imports inside it resolve * exactly as they would from the importer. That is what makes it usable for * modules a transform derives from the importing file, which is not what * `data:` promises, so it is deliberately not spelled `data:`. * * Its virtual path sits beside the importer, with the importer's extension and * a hash of the source in its name: `App.tsx` imports `App.inline-.tsx`. * So each distinct inline module gets its own path, the same source spelled * two ways is one module, and the transform treats it as the importer's kind * of file. * * The result is a pure function of (origin module, specifier). Nothing on disk * can invalidate it. */ export declare function resolveInlineModule(context: ResolutionContext, specifier: string): VirtualResolution;