diff --git a/src/puter-js/types/modules/apps.d.ts b/src/puter-js/types/modules/apps.d.ts index 1df13c9aa..6c7e2c838 100644 --- a/src/puter-js/types/modules/apps.d.ts +++ b/src/puter-js/types/modules/apps.d.ts @@ -1,4 +1,4 @@ -import type { PaginationOptions, RequestCallbacks } from '../shared.d.ts'; +import type { RequestCallbacks } from '../shared.d.ts'; export interface App { uid: string; @@ -16,12 +16,25 @@ export interface App { user_count?: number; } -export interface AppListOptions extends PaginationOptions { +export interface CreateAppResult { + uid: string; + name: string; + title: string; + index_url: string; + subdomain: string; + owner: { + username: string; + uuid: string; + }; + app_owner?: Record; +} + +export interface AppListOptions { stats_period?: string; icon_size?: null | 16 | 32 | 64 | 128 | 256 | 512; } -export interface CreateAppOptions extends RequestCallbacks { +export interface CreateAppOptions { name: string; indexURL: string; title?: string; @@ -34,7 +47,7 @@ export interface CreateAppOptions extends RequestCallbacks { dedupeName?: boolean; } -export interface UpdateAppAttributes extends RequestCallbacks { +export interface UpdateAppAttributes { name?: string; indexURL?: string; title?: string; @@ -48,10 +61,11 @@ export interface UpdateAppAttributes extends RequestCallbacks { export class Apps { list (options?: AppListOptions): Promise; - create (name: string, indexURL: string, title?: string): Promise; - create (options: CreateAppOptions): Promise; + create (name: string, indexURL: string, title?: string): Promise; + create (options: CreateAppOptions): Promise; update (name: string, attributes: UpdateAppAttributes): Promise; get (name: string, options?: AppListOptions): Promise; delete (name: string): Promise<{ success?: boolean }>; getDeveloperProfile (options?: RequestCallbacks>): Promise>; + getDeveloperProfile (success: (value: Record) => void, error?: (reason: unknown) => void): Promise>; }