diff --git a/types/ali-oss/ImageClient.d.ts b/types/ali-oss/ImageClient.d.ts index ec6ec9b71a..047077904f 100644 --- a/types/ali-oss/ImageClient.d.ts +++ b/types/ali-oss/ImageClient.d.ts @@ -1,6 +1,6 @@ -import {NormalSuccessResponse, RequestOptions} from "./index"; +import { NormalSuccessResponse, RequestOptions } from "./index"; -export interface Options { +export interface ImageClientOptions { imageHost: string, // your image service domain that binding to a OSS bucket accessKeyId: string, // access key you create on aliyun console website accessKeySecret: string, // access secret you create @@ -21,8 +21,8 @@ export interface StyleData { CreateTime: string, // style create time LastModifyTime: string // style last modify time } -export class Client { - constructor(options: Options) +export class ImageClient { + constructor(options: ImageClientOptions) /** * Get an image from the image channel. diff --git a/types/ali-oss/ali-oss-tests.ts b/types/ali-oss/ali-oss-tests.ts index e441e15577..a9c39ab199 100644 --- a/types/ali-oss/ali-oss-tests.ts +++ b/types/ali-oss/ali-oss-tests.ts @@ -5,14 +5,31 @@ const client = new OSS({ accessKeySecret: 'your access secret', bucket: 'your bucket name', region: 'oss-cn-hangzhou' -}); +}) + const ImageClient = OSS.ImageClient({ - imageHost: 'xxxx', - accessKeySecret: "xxxx", - accessKeyId: 'xxxxxx', + imageHost: 'host', + accessKeySecret: "secret", + accessKeyId: 'id', bucket: "", internal: false, region: "", - timeout: undefined + timeout: 2000 +}) + +const cluster = OSS.Cluster({ + clusters: [ + { + accessKeyId: 'id', + accessKeySecret: 'secret', + host: "" + }, + { + accessKeyId: 'id', + accessKeySecret: 'secret', + host: "" + }, + ], + schedule: 'masterSlave', }) diff --git a/types/ali-oss/index.d.ts b/types/ali-oss/index.d.ts index 1ced1efaf8..0f17bbb142 100644 --- a/types/ali-oss/index.d.ts +++ b/types/ali-oss/index.d.ts @@ -8,6 +8,10 @@ import * as ImageClientDefinition from './ImageClient' import * as ClusterDefinition from "./Cluster" +import {ImageClient} from "./ImageClient"; + +export * from './ImageClient' +export * from './Cluster' export interface Options { accessKeyId: string, // access secret you create @@ -22,7 +26,10 @@ export interface Options { } export type Bucket = { - + name: string, + region: string, + creationDate: string, + StorageClass: StorageType } export type StorageType = "Standard" | "IA" | "Archive" @@ -430,13 +437,9 @@ export interface GetRtmpUrlOptions { timeout?: number // the operation timeout } -export interface ObjectInterface { - -} - export default class OSS { // the image client - public static ImageClient: (options: ImageClientDefinition.Options) => ImageClientDefinition.Client + public static ImageClient: (options: ImageClientDefinition.ImageClientOptions) => ImageClientDefinition.ImageClient public static Cluster: (options: ClusterDefinition.ClusterOptions) => ClusterDefinition.Cluster constructor(options: Options) @@ -455,7 +458,8 @@ export default class OSS { /** * Create a new bucket. - * @param {string} name - bucket name If bucket exists and not belong to current account, will throw BucketAlreadyExistsError. If bucket not exists, will create a new bucket and set it's ACL. + * @param {string} name - bucket name If bucket exists and not belong to current account, will throw BucketAlreadyExistsError. + * If bucket not exists, will create a new bucket and set it's ACL. * @param {PutBucketOptions} options - optional parameters * @return { Promise<{ bucket: string, res: NormalSuccessResponse }> } */ @@ -952,4 +956,3 @@ export default class OSS { getRtmpUrl(channelId?: string, options?: GetRtmpUrlOptions): string } -