Urara-Blog/node_modules/.pnpm-store/v3/files/7c/19b9c661a2df4a46d642e046c76d24efc17dfbb8b442235fff35f55d6a4c7fb61d65ea30c7abd88aff4bbab863a09fd9ad37e5fd1ffee4f8c7e6be91a66d72
2022-08-14 01:14:53 +08:00

63 lines
1.7 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
// @ts-ignore Its important to preserve this ignore statement. This makes sure
// it works both with and without node types.
import {Buffer} from 'buffer'
import type {Reporter} from './lib/index.js'
/**
* This is the same as `Buffer` if node types are included, `never` otherwise.
*/
type MaybeBuffer = any extends Buffer ? never : Buffer
/**
* Contents of the file.
* Can either be text, or a Buffer like structure.
* This does not directly use type `Buffer`, because it can also be used in a
* browser context.
* Instead this leverages `Uint8Array` which is the base type for `Buffer`,
* and a native JavaScript construct.
*/
export type Value = string | MaybeBuffer
/**
* This map registers the type of the `data` key of a `VFile`.
*
* This type can be augmented to register custom `data` types.
*
* @example
* declare module 'vfile' {
* interface DataMap {
* // `file.data.name` is typed as `string`
* name: string
* }
* }
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface DataMap {}
/**
* Place to store custom information.
*
* Known attributes can be added to @see {@link DataMap}
*/
export type Data = Record<string, unknown> & Partial<DataMap>
// Deprecated names (w/ prefix):
export type {Data as VFileData, DataMap as VFileDataMap, Value as VFileValue}
export {VFile} from './lib/index.js'
export type {
BufferEncoding,
Map,
Compatible,
Options,
Reporter,
ReporterSettings,
// Deprecated names (w/ prefix):
Compatible as VFileCompatible,
Options as VFileOptions,
Reporter as VFileReporter,
ReporterSettings as VFileReporterSettings
} from './lib/index.js'