Skip to content

Commit dbfcd91

Browse files
committed
Fix types
1 parent 7af2f92 commit dbfcd91

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

scripts/generate-stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ const argv = yargs(hideBin(process.argv))
6363
default: paths.defaultStoriesConfig,
6464
describe:
6565
"Path to a multi-document yaml file with story configs. Each config is a map with name, folder, grouping, and figmaUrl fields."
66-
}).argv
66+
}).parseSync()
6767

6868
generateStories(argv.template, argv.stories)

scripts/typesense-admin.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { execSync } from "child_process"
22
import repl from "repl"
33
import { Client } from "typesense"
4-
import yargs from "yargs"
4+
import yargs, { Arguments } from "yargs"
55
import { hideBin } from "yargs/helpers"
66
import { createClient } from "../functions/src/search/client"
77

@@ -21,13 +21,13 @@ const envs: Record<string, { url: string; key?: string; alias?: string }> = {
2121
}
2222
}
2323

24-
type Args = { url?: string; key?: string; env?: string }
24+
type Args = Arguments<{ url?: string; key?: string; env?: string }>
2525
yargs(hideBin(process.argv))
2626
.scriptName("typesense-admin")
2727
.command(
2828
"console",
2929
"start a node repl with an initialized client",
30-
() => {},
30+
{},
3131
(args: Args) => {
3232
globalThis.client = resolveClient(args)
3333
repl.start({}).setupHistory("typesense-admin.history", () => {})
@@ -36,7 +36,7 @@ yargs(hideBin(process.argv))
3636
.command(
3737
"create-search-key",
3838
"create a new search key",
39-
() => {},
39+
{},
4040
async (args: Args) => {
4141
const client = resolveClient(args)
4242
const key = await client.keys().create({
@@ -50,7 +50,7 @@ yargs(hideBin(process.argv))
5050
.command(
5151
"list-keys",
5252
"list keys",
53-
() => {},
53+
{},
5454
async (args: Args) => {
5555
const client = resolveClient(args)
5656
console.log(await client.keys().retrieve())
@@ -59,8 +59,8 @@ yargs(hideBin(process.argv))
5959
.command(
6060
"delete-key <id>",
6161
"list keys",
62-
() => {},
63-
async (args: Args & { id: string }) => {
62+
{},
63+
async (args: Args & { id?: string }) => {
6464
const client = resolveClient(args)
6565
console.log(await client.keys(Number(args.id)).delete())
6666
}

0 commit comments

Comments
 (0)