Skip to content

Commit a36efd2

Browse files
authored
[telegram-web-app] Update ThemeParams jsdoc (DefinitelyTyped#74147)
1 parent aa8d0b5 commit a36efd2

1 file changed

Lines changed: 71 additions & 44 deletions

File tree

types/telegram-web-app/index.d.ts

Lines changed: 71 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -694,12 +694,12 @@ export type ShareMessageFailedCallback = (eventData: {
694694
export type EmojiStatusSetCallback = () => void;
695695
export type EmojiStatusFailedCallback = (eventData: {
696696
error:
697-
| "UNSUPPORTED"
698-
| "SUGGESTED_EMOJI_INVALID"
699-
| "DURATION_INVALID"
700-
| "USER_DECLINED"
701-
| "SERVER_ERROR"
702-
| "UNKNOWN_ERROR";
697+
| "UNSUPPORTED"
698+
| "SUGGESTED_EMOJI_INVALID"
699+
| "DURATION_INVALID"
700+
| "USER_DECLINED"
701+
| "SERVER_ERROR"
702+
| "UNKNOWN_ERROR";
703703
}) => void;
704704
export type EmojiStatusAccessRequestedCallback = (eventData: {
705705
status: "allowed" | "cancelled";
@@ -709,103 +709,130 @@ export type FileDownloadRequestedCallback = (eventData: {
709709
}) => void;
710710

711711
/**
712-
* Web Apps can adjust the appearance of the interface to match the Telegram
713-
* user's app in real time. This object contains the user's current theme
714-
* settings:
712+
* Mini Apps can adjust the appearance of the interface to match the Telegram user's app in real time.
713+
* This object contains the user's current theme setting
715714
*/
716715
export interface ThemeParams {
717716
/**
718717
* Background color in the `#RRGGBB` format.
719-
* Also available as the CSS variable `var(--tg-theme-bg-color)`.
718+
*
719+
* @see Available as the CSS variable `var(--tg-theme-bg-color)`.
720720
*/
721721
bg_color?: string;
722+
722723
/**
723724
* Main text color in the `#RRGGBB` format.
724-
* Also available as the CSS variable `var(--tg-theme-text-color)`.
725+
*
726+
* @see Available as the CSS variable `var(--tg-theme-text-color)`.
725727
*/
726728
text_color?: string;
729+
727730
/**
728731
* Hint text color in the `#RRGGBB` format.
729-
* Also available as the CSS variable `var(--tg-theme-hint-color)`.
732+
*
733+
* @see Available as the CSS variable `var(--tg-theme-hint-color)`.
730734
*/
731735
hint_color?: string;
736+
732737
/**
733738
* Link color in the `#RRGGBB` format.
734-
* Also available as the CSS variable `var(--tg-theme-link-color)`.
739+
*
740+
* @see Available as the CSS variable `var(--tg-theme-link-color)`.
735741
*/
736742
link_color?: string;
743+
737744
/**
738745
* Button color in the `#RRGGBB` format.
739-
* Also available as the CSS variable `var(--tg-theme-button-color)`.
746+
*
747+
* @see Available as the CSS variable `var(--tg-theme-button-color)`.
740748
*/
741749
button_color?: string;
750+
742751
/**
743752
* Button text color in the `#RRGGBB` format.
744-
* Also available as the CSS variable `var(--tg-theme-button-text-color)`.
753+
*
754+
* @see Available as the CSS variable `var(--tg-theme-button-text-color)`.
745755
*/
746756
button_text_color?: string;
757+
747758
/**
748-
* **Bot API 6.1+**
749-
*
750759
* Secondary background color in the `#RRGGBB` format.
751-
* Also available as the CSS variable `var(--tg-theme-secondary-bg-color)`.
760+
*
761+
* @since Bot API 6.1+
762+
*
763+
* @see Available as the CSS variable `var(--tg-theme-secondary-bg-color)`.
752764
*/
753765
secondary_bg_color?: string;
766+
754767
/**
755-
* **Bot API 7.0+**
756-
*
757768
* Header background color in the `#RRGGBB` format.
758-
* Also available as the CSS variable `var(--tg-theme-header-bg-color)`.
769+
*
770+
* @since Bot API 7.0+
771+
*
772+
* @see Available as the CSS variable `var(--tg-theme-header-bg-color)`.
759773
*/
760774
header_bg_color?: string;
775+
761776
/**
762-
* **Bot API 7.10+**
777+
* Bottom background color in the `#RRGGBB` format.
778+
*
779+
* @since Bot API 7.10+
763780
*
764-
* Bottom background color in the #RRGGBB format.
765-
* Also available as the CSS variable var(--tg-theme-bottom-bar-bg-color).
781+
* @see Available as the CSS variable `var(--tg-theme-bottom-bar-bg-color)`.
766782
*/
767783
bottom_bar_bg_color?: string;
784+
768785
/**
769-
* **Bot API 7.0+**
770-
*
771786
* Accent text color in the `#RRGGBB` format.
772-
* Also available as the CSS variable `var(--tg-theme-accent-text-color)`.
787+
*
788+
* @since Bot API 7.0+
789+
*
790+
* @see Available as the CSS variable `var(--tg-theme-accent-text-color)`.
773791
*/
774792
accent_text_color?: string;
793+
775794
/**
776-
* **Bot API 7.0+**
795+
* Section background color in the `#RRGGBB` format.
796+
*
797+
* @since Bot API 7.0+
777798
*
778-
* Background color for the section in the `#RRGGBB` format.
779-
* It is recommended to use this in conjunction with *secondary_bg_color*.
780-
* Also available as the CSS variable `var(--tg-theme-section-bg-color)`.
799+
* @see Available as the CSS variable `var(--tg-theme-section-bg-color)`.
781800
*/
782801
section_bg_color?: string;
802+
783803
/**
784-
* **Bot API 7.0+**
804+
* Section header text color in the `#RRGGBB` format.
805+
*
806+
* @since Bot API 7.0+
785807
*
786-
* Header text color for the section in the `#RRGGBB` format.
787-
* Also available as the CSS variable `var(--tg-theme-section-header-text-color)`.
808+
* @see Available as the CSS variable `var(--tg-theme-section-header-text-color)`.
788809
*/
789-
section_header_text_color?: `#${string}`;
810+
section_header_text_color?: string;
811+
790812
/**
791-
* **Bot API 7.6+**
792-
*
793813
* Section separator color in the `#RRGGBB` format.
794-
* Also available as the CSS variable `var(--tg-theme-section-separator-color)`.
814+
*
815+
* @since Bot API 7.6+
816+
*
817+
* @see Available as the CSS variable `var(--tg-theme-section-separator-color)`.
795818
*/
796819
section_separator_color?: string;
820+
797821
/**
798-
* **Bot API 7.0+**
799-
*
800822
* Subtitle text color in the `#RRGGBB` format.
801-
* Also available as the CSS variable `var(--tg-theme-subtitle-text-color)`.
823+
*
824+
* @since Bot API 7.0+
825+
*
826+
* @see Available as the CSS variable `var(--tg-theme-subtitle-text-color)`.
802827
*/
803828
subtitle_text_color?: string;
829+
804830
/**
805-
* **Bot API 7.0+**
831+
* Destructive text color in the `#RRGGBB` format.
832+
*
833+
* @since Bot API 7.0+
806834
*
807-
* Text color for destructive actions in the `#RRGGBB` format.
808-
* Also available as the CSS variable `var(--tg-theme-destructive-text-color)`.
835+
* @see Available as the CSS variable `var(--tg-theme-destructive-text-color)`.
809836
*/
810837
destructive_text_color?: string;
811838
}

0 commit comments

Comments
 (0)