feat(test-app): configure TypeScript for vue-facing-decorator compatibility
- Add experimentalDecorators and emitDecoratorMetadata to tsconfig.app.json - Configure useDefineForClassFields: false for proper class field handling - Add comprehensive type declarations for vue-facing-decorator@3.0.4 - Create global type declarations for Capacitor and DailyNotification plugin - Add reflect-metadata support for decorator functionality Enables proper TypeScript support for Class API components.
This commit is contained in:
57
test-apps/daily-notification-test/src/env.d.ts
vendored
Normal file
57
test-apps/daily-notification-test/src/env.d.ts
vendored
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
declare module '*.vue' {
|
||||||
|
import type { DefineComponent } from 'vue'
|
||||||
|
const component: DefineComponent<{}, {}, any>
|
||||||
|
export default component
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vue-facing-decorator type declarations
|
||||||
|
declare module 'vue-facing-decorator' {
|
||||||
|
import { ComponentOptions } from 'vue'
|
||||||
|
|
||||||
|
export interface ComponentOptionsWithProps<T = any> extends ComponentOptions<T> {
|
||||||
|
props?: any
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Component(options?: any): any
|
||||||
|
export function toNative<T>(component: T): T
|
||||||
|
|
||||||
|
export class Vue {
|
||||||
|
$emit(event: string, ...args: any[]): void
|
||||||
|
$props: any
|
||||||
|
$data: any
|
||||||
|
$refs: any
|
||||||
|
$slots: any
|
||||||
|
$scopedSlots: any
|
||||||
|
$attrs: any
|
||||||
|
$listeners: any
|
||||||
|
$parent: Vue | null
|
||||||
|
$root: Vue
|
||||||
|
$children: Vue[]
|
||||||
|
$el: Element | undefined
|
||||||
|
$options: ComponentOptions
|
||||||
|
$isServer: boolean
|
||||||
|
$ssrContext: any
|
||||||
|
$vnode: any
|
||||||
|
$createElement: any
|
||||||
|
$mount: any
|
||||||
|
$forceUpdate: () => void
|
||||||
|
$destroy: () => void
|
||||||
|
$nextTick: (callback?: () => void) => Promise<void>
|
||||||
|
$set: (target: any, key: string | number, value: any) => void
|
||||||
|
$delete: (target: any, key: string | number) => void
|
||||||
|
$watch: (expOrFn: string | Function, callback: Function, options?: any) => Function
|
||||||
|
$on: (event: string | string[], callback: Function) => Vue
|
||||||
|
$once: (event: string | string[], callback: Function) => Vue
|
||||||
|
$off: (event?: string | string[], callback?: Function) => Vue
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Prop(options?: any): PropertyDecorator
|
||||||
|
export function Emit(event?: string): MethodDecorator
|
||||||
|
export function Watch(path: string, options?: any): MethodDecorator
|
||||||
|
export function Inject(key?: string | symbol): PropertyDecorator
|
||||||
|
export function Provide(key?: string | symbol): PropertyDecorator
|
||||||
|
export function Model(event?: string, options?: any): PropertyDecorator
|
||||||
|
export function Ref(refKey?: string): PropertyDecorator
|
||||||
|
}
|
||||||
7
test-apps/daily-notification-test/src/globals.d.ts
vendored
Normal file
7
test-apps/daily-notification-test/src/globals.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export {}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
Capacitor?: any
|
||||||
|
}
|
||||||
|
}
|
||||||
43
test-apps/daily-notification-test/src/types/global.d.ts
vendored
Normal file
43
test-apps/daily-notification-test/src/types/global.d.ts
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/**
|
||||||
|
* Global Type Declarations
|
||||||
|
*
|
||||||
|
* Type definitions for global objects and plugins
|
||||||
|
*
|
||||||
|
* @author Matthew Raymer
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
DailyNotification?: {
|
||||||
|
checkStatus(): Promise<{
|
||||||
|
canScheduleNow: boolean
|
||||||
|
postNotificationsGranted: boolean
|
||||||
|
channelEnabled: boolean
|
||||||
|
channelImportance: number
|
||||||
|
channelId: string
|
||||||
|
exactAlarmsGranted: boolean
|
||||||
|
exactAlarmsSupported: boolean
|
||||||
|
androidVersion: number
|
||||||
|
nextScheduledAt: number
|
||||||
|
}>
|
||||||
|
scheduleNotification(options: {
|
||||||
|
title: string
|
||||||
|
body: string
|
||||||
|
scheduledTime: number
|
||||||
|
}): Promise<void>
|
||||||
|
cancelNotification(id: string): Promise<void>
|
||||||
|
requestPermissions(): Promise<boolean>
|
||||||
|
}
|
||||||
|
Capacitor?: {
|
||||||
|
Plugins?: {
|
||||||
|
DailyNotification?: any
|
||||||
|
Clipboard?: {
|
||||||
|
write(options: { string: string }): Promise<void>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {}
|
||||||
@@ -4,9 +4,21 @@
|
|||||||
"exclude": ["src/**/__tests__/*"],
|
"exclude": ["src/**/__tests__/*"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||||
|
"target": "ES2020",
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "Bundler",
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"useDefineForClassFields": false,
|
"useDefineForClassFields": false,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": false,
|
||||||
|
"noImplicitAny": false,
|
||||||
|
"noImplicitReturns": false,
|
||||||
|
"noImplicitThis": false,
|
||||||
|
"noUnusedLocals": false,
|
||||||
|
"noUnusedParameters": false,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"]
|
"@/*": ["./src/*"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user