Files
SnowLuma/.pnpm-store/v11/files/ca/d46999bb141c588b3a9060a80bb89ca3b08c4176ec258f3d9196cae73b3c95204ff88cd03068913044a6734b740d67f8f1166ab45812a9c5e53ce2777b6946
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

47 lines
1.1 KiB
Plaintext

/*!
* content-type
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/**
* The content type object contains a type string and optional parameters.
*/
export interface ContentType {
type: string;
index: number;
parameters: Record<string, string>;
}
/**
* Format an object into a `Content-Type` header.
*/
export declare function format(obj: Partial<ContentType>): string;
/**
* Options for parsing a `Content-Type` header.
*/
export interface ParseOptions {
/**
* Exit early on the first semicolon, returning only the type.
* This is useful for parsing the MIME from `Content-Type` headers.
*
* @default false
*/
parameters?: boolean;
/**
* Exits early on a comma, returning the first value and parameters.
* This is useful for parsing `Accept` headers.
*
* @default false
*/
comma?: boolean;
/**
* The index to start parsing from.
*
* @default 0
*/
start?: number;
}
/**
* Parse a `Content-Type` header.
*/
export declare function parse(header: string, options?: ParseOptions): ContentType;