Skip to content

Commit 8ffba24

Browse files
committed
chore: document deno support
1 parent c2b21e5 commit 8ffba24

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

.github/workflows/deno.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ jobs:
2929
echo -e "\n# Initialize some useful variables"
3030
REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
3131
32-
echo "TARGET_BRANCH: ${TARGET_BRANCH} GITHUB_BRANCH_NAME: ${GITHUB_BRANCH_NAME} REPO: ${REPO}"
33-
3432
echo -e "\n# Checkout the repo in the target branch"
3533
git clone $REPO out -b $TARGET_BRANCH
3634
@@ -42,7 +40,7 @@ jobs:
4240
git add --all .
4341
git config user.name "${GITHUB_ACTOR}"
4442
git config user.email "${GITHUB_EMAIL}"
45-
git commit -m "build: Deno build for ${GITHUB_SHA}" || true
43+
git commit -m "build: deno build for ${GITHUB_SHA}" || true
4644
git push origin $TARGET_BRANCH
4745
env:
4846
TARGET_BRANCH: '${{ env.GITHUB_BRANCH_NAME }}'

README.md

+34-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,43 @@ yarn add discord-api-types
1717
pnpm add discord-api-types
1818
```
1919

20+
We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them:
21+
22+
1. Directly from GitHub
23+
24+
```ts
25+
// Importing the default API version
26+
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/.deno/mod.ts';
27+
28+
// Importing a specific API version
29+
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/.deno/v8/mod.ts';
30+
```
31+
32+
2. From [deno.land/x](https://deno.land/x)
33+
34+
```ts
35+
// Importing the default API version
36+
import { APIUser } from 'https://deno.land/x/[email protected]/mod.ts';
37+
38+
// Importing a specific API version
39+
import { APIUser } from 'https://deno.land/x/[email protected]/v8/mod.ts';
40+
```
41+
42+
3. From [skypack.dev](https://www.skypack.dev/)
43+
44+
```ts
45+
// Importing the default API version
46+
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types?dts';
47+
48+
// Importing a specific API version
49+
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v8?dts';
50+
```
51+
2052
## Project Structure
2153

2254
The exports of each API version is split into three main parts:
2355

24-
- Everything exported with the `API` prefix represents a payload you may get from the REST API *or* the Gateway.
56+
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
2557

2658
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
2759

@@ -41,7 +73,7 @@ The exports of each API version is split into three main parts:
4173

4274
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `common` directory. They will still be prefixed accordingly as described above.
4375

44-
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means *and have received the green light to be used*). For clarification's sake, this means that properties that are only known through the process of datamining and have not yet been confirmed in a way as described will NOT be included.
76+
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will NOT be included.
4577

4678
## Usage
4779

0 commit comments

Comments
 (0)