docs(helpers,types): add discord doc links & remove leftover comments (#2223)

* deno fmt

* fix TODO comments and commented code

* revert changes to template

* remove reference

Co-authored-by: ITOH <to@itoh.at>
This commit is contained in:
LTS20050703
2022-05-16 01:15:03 +07:00
committed by GitHub
parent c2e3ef47b9
commit 6926ec1d29
2 changed files with 2 additions and 50 deletions

View File

@@ -933,8 +933,7 @@ export interface DiscordActivitySecrets {
match?: string;
}
// https://github.com/discord/discord-api-docs/pull/2219
// TODO: add documentation link
/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-buttons */
export interface DiscordActivityButton {
/** The text shown on the button (1-32 characters) */
label: string;

View File

@@ -249,7 +249,7 @@ export enum PremiumTiers {
Tier3,
}
// TODO: add resource link
/** https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level */
export enum GuildNsfwLevel {
Default,
Explicit,
@@ -1296,53 +1296,6 @@ export type Camelize<T> = {
: never;
};
// export type Optionalize<T> = T extends object ?
// & {
// [K in KeysWithUndefined<T>]?: Optionalize<T[K]>;
// }
// & {
// [K in Exclude<keyof T, KeysWithUndefined<T>>]: Optionalize<T[K]>;
// }
// : T;
// export type KeysWithUndefined<T> = {
// [K in keyof T]-?: (undefined | null) extends T[K] ? K : never;
// }[keyof T];
// export type Optionalize<T> = (
// & {
// [K in KeysWithUndefined<T>]?: Optionalize<T[K]>;
// }
// & {
// [K in Exclude<keyof T, KeysWithUndefined<T>>]: (
// // deno-lint-ignore ban-types
// T[K] extends object ? Object extends Pick<T[K], keyof T[K]> ? T[K] : Optionalize<T[K]> : T[K]
// );
// }
// );
// export type KeysWithUndefined<T> = {
// [K in keyof T]-?: undefined extends T[K] ? K
// : null extends T[K] ? K
// : never;
// }[keyof T];
// export type Optionalize<T> = T extends object ? (
// & {
// [K in KeysWithUndefined<T>]?: T[K] extends Collection<any, any> ? T[K]
// : T[K] extends any[] ? T[K]
// : Optionalize<T[K]>;
// }
// & {
// [K in Exclude<keyof T, KeysWithUndefined<T>>]: T[K] extends object ? Object extends Pick<T[K], keyof T[K]> ? T[K]
// : T[K] extends Collection<any, any> ? T[K]
// : T[K] extends any[] ? T[K]
// : Optionalize<T[K]>
// : T[K];
// }
// )
// : T;
export type Id<T> = T extends infer U ? {
[K in keyof U]: U[K];
}