-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: check jsdoc examples. (#1263)
- Loading branch information
1 parent
4b0f5e4
commit 25b6715
Showing
23 changed files
with
188 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import type { | ||
ColumnType, | ||
Generated, | ||
GeneratedAlways, | ||
Insertable, | ||
Kysely, | ||
Selectable, | ||
Updateable, | ||
} from './dist/esm' | ||
|
||
interface Database { | ||
person: PersonTable | ||
pet: PetTable | ||
wine: WineTable | ||
wine_stock_change: WineStockChangeTable | ||
} | ||
|
||
interface PersonTable { | ||
id: Generated<number> | ||
address: { city: string } | null | ||
age: number | null | ||
birthdate: ColumnType<Date | null, string | null | undefined, string | null> | ||
created_at: GeneratedAlways<Date> | ||
deleted_at: ColumnType<Date | null, string | null | undefined, string | null> | ||
experience: { role: string }[] | null | ||
first_name: string | ||
gender: 'male' | 'female' | 'other' | null | ||
has_pets: Generated<'Y' | 'N'> | ||
last_name: string | null | ||
middle_name: string | null | ||
nicknames: string[] | null | ||
nullable_column: string | null | ||
profile: { | ||
addresses: { city: string }[] | ||
website: { url: string } | ||
} | null | ||
updated_at: ColumnType<Date | null, string | null | undefined, string | null> | ||
} | ||
|
||
interface PetTable { | ||
id: Generated<number> | ||
is_favorite: Generated<boolean> | ||
name: string | ||
owner_id: number | ||
species: Species | ||
} | ||
|
||
interface WineTable { | ||
name: string | ||
stock: number | ||
} | ||
|
||
interface WineStockChangeTable { | ||
stock_delta: number | ||
wine_name: string | ||
} | ||
|
||
export type Person = Selectable<PersonTable> | ||
export type NewPerson = Insertable<PersonTable> | ||
export type PersonUpdate = Updateable<PersonTable> | ||
export type Pet = Selectable<PetTable> | ||
export type NewPet = Insertable<PetTable> | ||
export type PetUpdate = Updateable<PetTable> | ||
export type Species = 'dog' | 'cat' | ||
|
||
declare global { | ||
export const db: Kysely<Database> | ||
export function functionThatExpectsPersonWithNonNullValue( | ||
person: Person & { nullable_column: string }, | ||
): void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json", | ||
"compilerOptions": { | ||
"types": ["./deno.check.d.ts"] | ||
}, | ||
"imports": { | ||
"better-sqlite3": "npm:better-sqlite3", | ||
"kysely": "./dist/esm", | ||
"kysely/helpers/postgres": "./dist/esm/helpers/postgres.js", | ||
"mysql2": "npm:mysql2", | ||
"pg": "npm:pg", | ||
"pg-cursor": "npm:pg-cursor", | ||
"tarn": "npm:tarn", | ||
"tedious": "npm:tedious", | ||
"type-editor": "./deno.check.d.ts" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.