Note: You can also import any type from the default module,
./mod.ts
import { type DenoJson } from "https://deno.land/x/typedefs@0.0.1/deno-json.d.ts";
interface DenoJson {
$schema: "https://denopkg.com/denoland/deno/cli/schemas/config-file.v1.json";
compilerOptions: {
allowJs: boolean;
allowUnreachableCode: boolean;
allowUnusedLabels: boolean;
checkJs: boolean;
experimentalDecorators: boolean;
... 22 more ...;
suppressImplicitAnyIndexErrors?: boolean;
};
importMap: string;
fmt: DenoJson.Fmt;
lint: DenoJson.Lint;
tasks: DenoJson.Tasks;
test: DenoJson.Test;
}
Type for deno's import_map.json
file.
import { type ImportMapJson } from "https://deno.land/x/typedefs@0.0.1/import-map-json.d.ts";
interface ImportMap {
$schema:
"https://denopkg.com/denoland/vscode_deno/schemas/import_map.schema.json";
imports: {
[specifier: string]: string;
};
scopes: {
[scope: string]: {
[specifier: string]: string;
};
};
}
Type for nest.land's egg.json
file used by the eggs
CLI.
import { type EggJson } from "https://deno.land/x/typedefs@0.0.1/egg-json.d.ts";
interface EggJson {
$schema: "https://x.nest.land/eggs@0.3.10/src/schema.json";
name: string;
description: string;
repository: string;
homepage: string;
... 12 more ...;
checkTests: boolean | string;
}
Type for npm's package.json
file. Also includes types for fields used by other popular projects, like TypeScript, PNPM, Yarn. Based on the type-fest package.json definition by Sindre Sorhus, with some added support for PNPM.
import { type PackageJson } from "https://deno.land/x/typedefs@0.0.1/package-json.d.ts";
interface PackageJson {
name?: string | undefined;
version?: string | undefined;
description?: string | undefined;
keywords?: string[] | undefined;
homepage?: "." | {} | undefined;
bugs?: string | {
url?: string | undefined;
email?: string | undefined;
} | undefined;
... 44 more ...;
pnpm?: {
...;
} | undefined;
}
Type for TypeScript's tsconfig.json
file (TypeScript 3.7).
import { type TsConfigJson } from "https://deno.land/x/typedefs@0.0.1/tsconfig-json.d.ts";
Note: Taken from the type-fest project by Sindre Sorhus.
interface TsConfigJson {
compilerOptions?: {
charset?: string | undefined;
composite?: boolean | undefined;
declaration?: boolean | undefined;
declarationDir?: string | undefined;
diagnostics?: boolean | undefined;
... 97 more ...;
explainFiles?: boolean | undefined;
} | undefined;
... 7 more ...;
references?: {
...;
}[] | undefined;
}
This section assumes you have the GitHub CLI.
Create a new instance with the GitHub CLI, or just create one from your repository homepage on github.com.
gh codespace create --repo deno911/typedefs
Open a new workspace by prepending https://gitpod.io/#
to your repository URL
and visiting it in your browser:
https://gitpod.io/#https://github.com/deno911/typedefs
gh repo fork deno911/typedefs --clone
git checkout -b fix/typo-in-readme
# hack hack hack...
git commit README.md -m "fix: typos in README.md" && git push
Note: keep the scope of your changes relevant and concise.
Unless, of course, you're fixing a bug for which an issue already exists!
This allows the issue to be connected to your Pull Request, creating a permanent record of your contribution to the project. It also makes it easier for maintainers to track project progression.
Creating an issue also ensures you're given proper credit for fixing that bug ;)
gh pr create --title "fix: typos in README.md"
Or just open your repo on GitHub.com and follow the prompts.
Warning: make sure you select the upstream repo for your PR!