Skip to content

Commit

Permalink
Add *.d.ts to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AlttiRi committed Aug 21, 2024
1 parent 435f3ab commit e881f52
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,39 @@ The optimisation for `"ascii85"` by replacing `"\0\0\0\0"` by `"z"` instead of `

Anyway nobody forbids you to do something like `base85.replaceAll("!!!!!", "z")` as well as to add `"<~"`, `"~>"` manually if you need it.

---

# *.d.ts

```ts
/** 85 unique characters string */
type CharSet = string;
/**
* Returns Base85 string.
* @param {Uint8Array} ui8a - input data to encode
* @param {"ascii85" | "z85" | string} [charset="z85"] - 85 unique characters string
* @return {string}
* */
export declare function encode(ui8a: Uint8Array, charset?: "ascii85" | "z85" | CharSet): string;
/**
* Decodes Base85 string.
* @param {string} base85 - base85 encoded string
* @param {"ascii85" | "z85" | string} [charset="z85"] - 85 unique characters string
* @return {Uint8Array}
* */
export declare function decode(base85: string, charset?: "ascii85" | "z85" | CharSet): Uint8Array;
/** Alias to `encode`. */
export declare const encodeBase85: typeof encode;
/** Alias to `decode`. */
export declare const decodeBase85: typeof decode;
declare const base85: {
encode: typeof encode;
decode: typeof decode;
encodeBase85: typeof encode;
decodeBase85: typeof decode;
};
export default base85;
```

---

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alttiri/base85",
"version": "1.7.5",
"version": "1.7.6",
"description": "Pretty fast base85 JavaScript library",
"homepage": "https://github.com/alttiri/base85",
"keywords": [
Expand Down

0 comments on commit e881f52

Please sign in to comment.