-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: move types in a single declaration file
- Loading branch information
Showing
8 changed files
with
57 additions
and
52 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
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,44 @@ | ||
import { | ||
Context, | ||
Conversation, | ||
ConversationFlavor, | ||
SessionFlavor, | ||
z, | ||
} from '@deps' | ||
|
||
export const itemSchema = z.object({ | ||
id: z.number(), | ||
deleted: z.optional(z.boolean()), | ||
type: z.optional(z.string()), | ||
by: z.optional(z.string()), | ||
time: z.optional(z.number()), | ||
text: z.optional(z.string()), | ||
dead: z.optional(z.boolean()), | ||
parent: z.optional(z.number()), | ||
poll: z.optional(z.unknown()), | ||
kids: z.optional(z.unknown()), | ||
url: z.optional(z.string()), | ||
score: z.optional(z.number()), | ||
title: z.optional(z.string()), | ||
parts: z.optional(z.unknown()), | ||
descendants: z.optional(z.number()), | ||
}).nullable() | ||
|
||
export type Item = z.infer<typeof itemSchema> | ||
|
||
const storySchema = z.number() | ||
|
||
export const storiesSchema = z.array(storySchema) | ||
|
||
export type TopStories = z.infer<typeof storiesSchema> | ||
|
||
export interface SessionData { | ||
preferences: string[] | ||
} | ||
|
||
export type PreferencesContext = | ||
& Context | ||
& SessionFlavor<SessionData> | ||
& ConversationFlavor | ||
|
||
export type ConversationContext = Conversation<PreferencesContext> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
abbd357
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed to deploy: