Skip to content

Commit

Permalink
fix: anything around stupid ts code (squashed)
Browse files Browse the repository at this point in the history
fix: whatever
apparently 1.1.3 never works

fix: commonjs option?

fix: dfy2c

fix: wrong shcema
  • Loading branch information
hUwUtao committed Jun 4, 2024
1 parent d6456eb commit 95761c0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@team-fuho/wt",
"version": "1.1.3",
"version": "1.1.7",
"description": "",
"type": "module",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"type": "commonjs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"/dist"
],
Expand Down
11 changes: 8 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ export class Model<T> {
}

/**
* @todo generic return type
* @description to return stuff, ofc
*/
async query(options: GenericParameter, id?: number): Promise<(TResponse & T)[]> {
return fetch(this.requestBuilder(options, id)).then((ok) => ok.json());
async query(options: GenericParameter, id?: number, init?: RequestInit): Promise<{
meta: {
total_count: Number
},
items: (TResponse & T)[]
}> {
return fetch(this.requestBuilder(options, id), Object.assign({}, init)).then((ok) => ok.json());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function BlogPage(ctx: Context) {
intro: string,
body: string,
thumbnail_set: Record<string, string>
}>("gallery.Picture", ctx)
}>("blog.BlogPage", ctx)
}

export function GalleryPicture(ctx: Context) {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"module": "commonjs",
"module": "CommonJS",
"target": "ESNext",
"declaration": true,
"outDir": "./dist"
Expand Down

0 comments on commit 95761c0

Please sign in to comment.