| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- interface HTMLElement {
- webkitRequestFullScreen(options?: FullscreenOptions): Promise<void>
- mozRequestFullScreen(options?: FullscreenOptions): Promise<void>
- msRequestFullscreen(options?: FullscreenOptions): Promise<void>
- }
- interface Document {
- webkitFullscreenElement: Element | null
- mozFullScreenElement: Element | null
- msFullscreenElement: Element | null
- webkitCurrentFullScreenElement: Element | null
- mozCancelFullScreen(): Promise<void>
- webkitExitFullscreen(): Promise<void>
- msExitFullscreen(): Promise<void>
- }
- // AWS SDK 类型声明
- /*
- interface Window {
- AWS: {
- config: {
- update: (credentials: { accessKeyId: string; secretAccessKey: string }) => void
- region: string
- }
- S3: new (config: { params: { Bucket: string } }) => {
- getObject: (params: { Bucket: string; Key: string }, callback: (err: any, data: any) => void) => void
- }
- }
- }
- */
- interface Window {
- AWS: {
- config: {
- update: (credentials: { accessKeyId: string; secretAccessKey: string }) => void;
- region: string;
- };
- S3: new (config: { params: { Bucket: string }, httpOptions: { timeout: number } }) => S3Instance;
- };
- }
- // 定义 S3 实例的方法
- interface S3Instance {
- getObject(params: { Bucket: string; Key: string }, callback: (err: any, data: any) => void): void;
- upload(params: S3UploadParams, options?: S3UploadOptions): S3ManagedUpload;
- }
- // upload 方法的参数
- interface S3UploadParams {
- Key: string;
- ContentType: string;
- Body: File | Blob;
- ACL?: string;
- // 其他可选参数...
- }
- // upload 方法的选项
- interface S3UploadOptions {
- partSize?: number;
- queueSize?: number;
- leavePartsOnError?: boolean;
- }
- // upload 返回的管理对象
- interface S3ManagedUpload {
- promise(): Promise<S3UploadResult>;
- on(event: string, listener: (...args: any[]) => void): this;
- send(callback: (err: any, data: any) => void): void;
- }
- // upload 成功返回的数据
- interface S3UploadResult {
- Location: string;
- ETag: string;
- Bucket: string;
- Key: string;
- }
|