diff --git a/docs/mini-apps/composables/use-web-app.md b/docs/mini-apps/composables/use-web-app.md index 266f020..22f0770 100644 --- a/docs/mini-apps/composables/use-web-app.md +++ b/docs/mini-apps/composables/use-web-app.md @@ -22,13 +22,5 @@ import { useWebApp } from 'vue-tg' | `isReady` | `Readonly>` | | `isPlatform` | `(name: string) => boolean` | | `isPlatformUnknown` | `boolean` | -| `isPlatformAndroid` | `boolean` | -| `isPlatformAndroidX` | `boolean` | -| `isPlatformIOS` | `boolean` | -| `isPlatformMacOS` | `boolean` | -| `isPlatformTDesktop` | `boolean` | -| `isPlatformWebA` | `boolean` | -| `isPlatformWebK` | `boolean` | -| `isPlatformUnigram` | `boolean` | | `isFeatureSupported` | `(name: string) => boolean` | | `canSendData` | `boolean` | diff --git a/src/composables/useWebApp.ts b/src/composables/useWebApp.ts index 8ae2e2a..5001762 100644 --- a/src/composables/useWebApp.ts +++ b/src/composables/useWebApp.ts @@ -18,17 +18,21 @@ const ready: typeof Telegram.WebApp.ready = (...params) => { isReady.value = true } -const isPlatform = (name: string) => Telegram.WebApp.platform === name +const isPlatform = ( + name: + | (string & Record) + | "unknown" + | "android" + | "android_x" + | "ios" + | "macos" + | "tdesktop" + | "weba" + | "webk" + | "unigram", +) => Telegram.WebApp.platform === name const isPlatformUnknown = isPlatform("unknown") -const isPlatformAndroid = isPlatform("android") -const isPlatformAndroidX = isPlatform("android_x") -const isPlatformIOS = isPlatform("ios") -const isPlatformMacOS = isPlatform("macos") -const isPlatformTDesktop = isPlatform("tdesktop") -const isPlatformWebA = isPlatform("weba") -const isPlatformWebK = isPlatform("webk") -const isPlatformUnigram = isPlatform("unigram") const featureSupportVersion = { ClosingConfirmation: "6.2", @@ -93,14 +97,6 @@ export function useWebApp() { isReady: readonly(isReady), isPlatform, isPlatformUnknown, - isPlatformAndroid, - isPlatformAndroidX, - isPlatformIOS, - isPlatformMacOS, - isPlatformTDesktop, - isPlatformWebA, - isPlatformWebK, - isPlatformUnigram, isFeatureSupported, canSendData, }