Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(archive): mark public APIs as unstable/experimental #5639

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions archive/_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
import { PartialReadError } from "@std/io/buf-reader";
import type { Reader } from "@std/io/types";

/** Base interface for {@linkcode TarMeta} */
/**
* Base interface for {@linkcode TarMeta}.
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*/
export interface TarInfo {
/**
* The underlying raw `st_mode` bits that contain the standard Unix
Expand Down Expand Up @@ -37,7 +44,14 @@ export interface TarInfo {
type?: string;
}

/** Base interface for {@linkcode TarMetaWithLinkName}. */
/**
* Base interface for {@linkcode TarMetaWithLinkName}.
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*/
export interface TarMeta extends TarInfo {
/**
* The name of the file, with directory names (if any) preceding the file
Expand Down
5 changes: 5 additions & 0 deletions archive/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
* writer.close();
* ```
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*
* @module
*/
export * from "./tar.ts";
Expand Down
32 changes: 29 additions & 3 deletions archive/tar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ import { HEADER_LENGTH } from "./_common.ts";

export type { TarInfo, TarMeta };

/** Options for {@linkcode Tar.append}. */
/**
* Options for {@linkcode Tar.append}.
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*/
export interface TarOptions extends TarInfo {
/**
* Filepath of the file to append to the archive
Expand Down Expand Up @@ -115,7 +122,14 @@ function formatHeader(data: TarData): Uint8Array {
return buffer;
}

/** Base interface for {@linkcode TarDataWithSource}. */
/**
* Base interface for {@linkcode TarDataWithSource}.
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*/
export interface TarData {
/** Name of the file, excluding directory names (if any). */
fileName?: string;
Expand Down Expand Up @@ -162,7 +176,14 @@ export interface TarData {
group?: string;
}

/** Tar data interface for {@linkcode Tar.data}. */
/**
* Tar data interface for {@linkcode Tar.data}.
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*/
export interface TarDataWithSource extends TarData {
/**
* Path of the file to read.
Expand Down Expand Up @@ -228,6 +249,11 @@ export interface TarDataWithSource extends TarData {
* await copy(tar.getReader(), writer);
* writer.close();
* ```
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*/
export class Tar {
/** Tar data. */
Expand Down
37 changes: 34 additions & 3 deletions archive/untar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,25 @@ import type { Reader } from "@std/io/types";
/**
* Extend TarMeta with the `linkName` property so that readers can access
* symbolic link values without polluting the world of archive writers.
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*/
export interface TarMetaWithLinkName extends TarMeta {
/** File name of the symbolic link. */
linkName?: string;
}

/** Tar header with raw, unprocessed bytes as values. */
/**
* Tar header with raw, unprocessed bytes as values.
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*/
export type TarHeader = {
[key in UstarFields]: Uint8Array;
};
Expand Down Expand Up @@ -85,10 +97,24 @@ function parseHeader(buffer: Uint8Array): TarHeader {
return data;
}

/** Tar entry */
/**
* Tar entry
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*/
export interface TarEntry extends TarMetaWithLinkName {}

/** Contains tar header metadata and a reader to the entry's body. */
/**
* Contains tar header metadata and a reader to the entry's body.
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*/
export class TarEntry implements Reader {
#reader: Reader | (Reader & Deno.Seeker);
#size: number;
Expand Down Expand Up @@ -218,6 +244,11 @@ export class TarEntry implements Reader {
* await copy(entry, file);
* }
* ```
*
* > [!WARNING]
* > **UNSTABLE**: New API, yet to be vetted.
*
* @experimental
*/
export class Untar {
/** Internal reader. */
Expand Down