-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add typings #11
base: master
Are you sure you want to change the base?
Conversation
pls take a look @vitalets |
type: "BigImage"; | ||
image_id?: string; | ||
title?: string; | ||
descriptions?: string; |
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.
descriptions?: string; | |
description?: string; |
items: Array<string | Button>, | ||
defaults?: Button | ||
): Button[]; | ||
declare function audio(name: string): void; |
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.
Эта штука возвращает объект с одним полем tts
. Думаю, можно сделать тип ResponseTts
и все функции влияющие на аудио-часть (audio(), effect(), pause(), tts()
) будут возвращать его.
По аналогии можно сделать ResponseText
для text(), br()
.
two: string, | ||
five: string | ||
): void; | ||
declare function enumerate(list: any[]): void; |
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.
Возвращает строку
): void; | ||
declare function enumerate(list: any[]): void; | ||
|
||
declare function userify(userId: string, target: typeof reply): typeof reply; |
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.
target здесь это функция
declare function enumerate(list: any[]): void; | ||
|
||
declare function userify(userId: string, target: typeof reply): typeof reply; | ||
declare function userify( |
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.
Мне кажется, эту функцию можно одной декларацией описать через дженерик. Она всегда возвращает тип, который у target. Только вот по синтаксису как это описать в ts не знаю.
seconds?: number; | ||
leading: boolean; | ||
}, | ||
response: any |
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.
по идее здесь передается Response
, только без end_session.
button?: Button; | ||
} | ||
): { | ||
type: "BigImage"; |
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.
завести BigImageCard
, чтобы не дублировать это описание?
heya i added typescript typings to use it in here as default rendering engine