webpack-sources/000755 001751 000177 0000000000 14522514440015631 5ustar00runner000000 000000 1452251444014522514440webpack-sources/LICENSE000644 001751 000177 0000002165 14522514440016642 0ustar00runner000000 000000 1452251444014522514440 MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE webpack-sources/README.md000644 001751 000177 0000001417 14522514440017115 0ustar00runner000000 000000 1452252150714522514440# Installation > `npm install --save @types/webpack-sources` # Summary This package contains type definitions for webpack-sources (https://github.com/webpack/webpack-sources). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webpack-sources. ### Additional Details * Last updated: Tue, 07 Nov 2023 20:08:00 GMT * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/source-list-map](https://npmjs.com/package/@types/source-list-map), [source-map](https://npmjs.com/package/source-map) # Credits These definitions were written by [e-cloud](https://github.com/e-cloud), [Chris Eppstein](https://github.com/chriseppstein), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). webpack-sources/index.d.ts000644 001751 000177 0000001354 14522514440017535 0ustar00runner000000 000000 1452251444014522514440/// export import CachedSource = require("./lib/CachedSource"); export import CompatSource = require("./lib/CompatSource"); export import ConcatSource = require("./lib/ConcatSource"); export import OriginalSource = require("./lib/OriginalSource"); export import PrefixSource = require("./lib/PrefixSource"); export import RawSource = require("./lib/RawSource"); export import ReplaceSource = require("./lib/ReplaceSource"); export import SizeOnlySource = require("./lib/SizeOnlySource"); export import Source = require("./lib/Source"); export import SourceMapSource = require("./lib/SourceMapSource"); export { CachedData, MapOptions, Replacement, SourceAndMapMixin, SourceAndMapResult, SourceLike } from "./lib/index"; webpack-sources/lib/000755 001751 000177 0000000000 14522514440016377 5ustar00runner000000 000000 1452251444014522514440webpack-sources/package.json000644 001751 000177 0000002335 14522514440020124 0ustar00runner000000 000000 1452252150714522514440{ "name": "@types/webpack-sources", "version": "3.2.3", "description": "TypeScript definitions for webpack-sources", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webpack-sources", "license": "MIT", "contributors": [ { "name": "e-cloud", "githubUsername": "e-cloud", "url": "https://github.com/e-cloud" }, { "name": "Chris Eppstein", "githubUsername": "chriseppstein", "url": "https://github.com/chriseppstein" }, { "name": "Piotr Błażejewicz", "githubUsername": "peterblazejewicz", "url": "https://github.com/peterblazejewicz" } ], "main": "", "types": "index.d.ts", "repository": { "type": "git", "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", "directory": "types/webpack-sources" }, "scripts": {}, "dependencies": { "@types/node": "*", "@types/source-list-map": "*", "source-map": "^0.7.3" }, "typesPublisherContentHash": "7bdf9048654ee82707e648ea73eb0dbef57288a82d4076860bac7b3e738fd185", "typeScriptVersion": "4.5" }webpack-sources/lib/CachedSource.d.ts000644 001751 000177 0000001073 14522514440021522 0ustar00runner000000 000000 1452251444014522514440import { RawSourceMap } from "source-map"; import { CachedData, MapOptions } from "."; import Source = require("./Source"); /** * Decorates a Source and caches returned results of map, source, size and sourceAndMap in memory. * Every other operation is delegated to the wrapped Source. */ declare class CachedSource extends Source { constructor(source: null | (() => Source), cachedData: CachedData); constructor(source: Source); map(options?: MapOptions): RawSourceMap; original(): Source; getCachedData(): CachedData; } export = CachedSource; webpack-sources/lib/CompatSource.d.ts000644 001751 000177 0000000365 14522514440021601 0ustar00runner000000 000000 1452251444014522514440import { SourceLike } from "."; import Source = require("./Source"); declare class CompatSource extends Source { constructor(sourceLike: SourceLike); static from(sourceLike: SourceLike): Source | CompatSource; } export = CompatSource; webpack-sources/lib/ConcatSource.d.ts000644 001751 000177 0000001047 14522514440021563 0ustar00runner000000 000000 1452251444014522514440import { SourceListMap } from "source-list-map"; import { SourceNode } from "source-map"; import { MapOptions, SourceAndMapMixin } from "."; import Source = require("./Source"); /** * Concatenate multiple Sources or strings to a single source. */ declare class ConcatSource extends Source implements SourceAndMapMixin { children: Array; constructor(...args: Array); /** * Adds an item to the source. */ add(item: string | Source): void; source(): string; } export = ConcatSource; webpack-sources/lib/OriginalSource.d.ts000644 001751 000177 0000001102 14522514440022110 0ustar00runner000000 000000 1452251444014522514440import { SourceListMap } from "source-list-map"; import { SourceNode } from "source-map"; import { SourceAndMapMixin } from "."; import Source = require("./Source"); /** * Represents source code, which is a copy of the original file */ declare class OriginalSource extends Source implements SourceAndMapMixin { /** * OriginalSource tries to create column mappings if requested, by splitting the source code at typical statement borders (;, {, }). */ constructor(sourceCode: string | Buffer, name: string); source(): string; } export = OriginalSource; webpack-sources/lib/PrefixSource.d.ts000644 001751 000177 0000000526 14522514440021612 0ustar00runner000000 000000 1452251444014522514440import { SourceAndMapMixin } from "."; import Source = require("./Source"); /** * Prefix every line of the decorated Source with a provided string. */ declare class PrefixSource extends Source implements SourceAndMapMixin { constructor(prefix: Source | string, source: Source | string); source(): string; } export = PrefixSource; webpack-sources/lib/RawSource.d.ts000644 001751 000177 0000000424 14522514440021103 0ustar00runner000000 000000 1452251444014522514440import { MapOptions } from "."; import Source = require("./Source"); /** * Represents source code without SourceMap */ declare class RawSource extends Source { constructor(value: string); source(): string; map(options: MapOptions): null; } export = RawSource; webpack-sources/lib/ReplaceSource.d.ts000644 001751 000177 0000002012 14522514440021720 0ustar00runner000000 000000 1452251444014522514440import { Replacement, SourceAndMapMixin } from "."; import Source = require("./Source"); /** * Decorates a Source with replacements and insertions of source code. */ declare class ReplaceSource extends Source implements SourceAndMapMixin { replacements: Replacement[]; /** * The ReplaceSource supports "identity" mappings for child source. * When original source matches generated source for a mapping it's assumed to be mapped char by char allowing to split mappings at replacements/insertions. */ constructor(source: Source, name?: string); /** * Replaces chars from start (0-indexed, inclusive) to end (0-indexed, inclusive) with replacement. */ replace(start: number, end: number, newValue: string, name?: string): void; /** * Inserts the insertion before char pos (0-indexed). */ insert(pos: number, newValue: string, name?: string): void; /** * Get decorated Source. */ original(): Source; source(): string; } export = ReplaceSource; webpack-sources/lib/SizeOnlySource.d.ts000644 001751 000177 0000000217 14522514440022126 0ustar00runner000000 000000 1452251444014522514440import Source = require("./Source"); declare class SizeOnlySource extends Source { constructor(size: number); } export = SizeOnlySource; webpack-sources/lib/Source.d.ts000644 001751 000177 0000002457 14522514440020441 0ustar00runner000000 000000 1452251444014522514440import { Hash } from "crypto"; import { RawSourceMap } from "source-map"; import { MapOptions, SourceAndMapResult } from "."; /** * Base class for all sources. * A Source can be asked for source code, size, source map and hash. */ declare abstract class Source { /** * Returns the represented source code as string. */ source(): string | ArrayBuffer; /** * Returns the represented source code as Buffer. Strings are converted to utf-8. */ buffer(): Buffer; /** * Returns the size in chars of the represented source code. */ size(): number; /** * Returns the SourceMap of the represented source code as JSON. * May return `null` if no SourceMap is available. */ map(options?: MapOptions): RawSourceMap | null; /** * Returns both, source code (like `Source.prototype.source()` and SourceMap (like `Source.prototype.map()`). * This method could have better performance than calling `source()` and `map()` separately. */ sourceAndMap(options?: MapOptions): SourceAndMapResult; /** * Updates the provided Hash object with the content of the represented source code. * (Hash is an object with an update method, which is called with string values) */ updateHash(hash: Hash): void; } export = Source; webpack-sources/lib/SourceMapSource.d.ts000644 001751 000177 0000001220 14522514440022243 0ustar00runner000000 000000 1452251444014522514440import { RawSourceMap, SourceMapGenerator } from "source-map"; import { SourceAndMapMixin } from "."; import Source = require("./Source"); /** * Represents source code with SourceMap, optionally having an additional SourceMap for the original source. */ declare class SourceMapSource extends Source implements SourceAndMapMixin { constructor( sourceCode: string, name: string, sourceMap: SourceMapGenerator | RawSourceMap, originalSource?: string, innerSourceMap?: RawSourceMap | string, removeOriginalSource?: boolean, ); buffer(): Buffer; source(): string; } export = SourceMapSource; webpack-sources/lib/index.d.ts000644 001751 000177 0000003756 14522514440020313 0ustar00runner000000 000000 1452251444014522514440import { RawSourceMap } from "source-map"; export import CachedSource = require("./CachedSource"); export import CompatSource = require("./CompatSource"); export import ConcatSource = require("./ConcatSource"); export import OriginalSource = require("./OriginalSource"); export import PrefixSource = require("./PrefixSource"); export import RawSource = require("./RawSource"); export import ReplaceSource = require("./ReplaceSource"); export import SizeOnlySource = require("./SizeOnlySource"); export import Source = require("./Source"); export import SourceMapSource = require("./SourceMapSource"); export interface MapOptions { /** * If set to false the implementation may omit mappings for columns * @default true */ columns?: boolean | undefined; /** * If set to false the implementation may omit inner mappings for modules. * @default true */ module?: boolean | undefined; } export interface SourceAndMapMixin { /** * Returns the SourceMap of the represented source code as JSON. * May return `null` if no SourceMap is available. */ map(options?: MapOptions): RawSourceMap | null; /** * Returns both, source code (like `Source.prototype.source()` and SourceMap (like `Source.prototype.map()`). * This method could have better performance than calling `source()` and `map()` separately. */ sourceAndMap(options?: MapOptions): SourceAndMapResult; } export interface SourceAndMapResult { source: string | Buffer; map: RawSourceMap | null; } export interface Replacement { readonly start: number; readonly end: number; readonly content: string; readonly insertIndex: number; readonly name: string; } export type SourceLike = Partial>; export interface CachedData { buffer?: Buffer | undefined; source?: string | boolean | undefined; size?: number | undefined; cachedData?: Map | undefined; }