Skip to content

Commit

Permalink
Use GetObjectOpts in minio.d.ts (minio#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Florent FAYOLLE authored and fflorent committed Jul 18, 2023
1 parent cc1b234 commit 73d8027
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/internal/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export type Lifecycle = LifecycleConfig | null | ''
export type Lock = LockConfig | EmptyObject
export type Retention = RetentionOptions | EmptyObject
export type IsoDate = string
export type GetObjectOpt = {
export type GetObjectOpts = {
versionId?: string
}

Expand Down
46 changes: 42 additions & 4 deletions src/minio.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {
ENCRYPTION_TYPES,
EncryptionConfig,
EncryptionRule,
GetObjectOpts,
IncompleteUploadedBucketItem,
InputSerialization,
IsoDate,
Expand Down Expand Up @@ -49,6 +50,7 @@ import type {
RetentionOptions,
SelectOptions,
SourceObjectStats,
StatObjectOpts,
Tag,
TagList,
UploadedObjectInfo,
Expand All @@ -72,6 +74,7 @@ export type {
ENCRYPTION_TYPES,
EncryptionConfig,
EncryptionRule,
GetObjectOpts,
IncompleteUploadedBucketItem,
InputSerialization,
IsoDate,
Expand Down Expand Up @@ -99,6 +102,7 @@ export type {
RetentionOptions,
SelectOptions,
SourceObjectStats,
StatObjectOpts,
Tag,
TagList,
UploadedObjectInfo,
Expand Down Expand Up @@ -216,7 +220,13 @@ export class Client extends TypedClient {

// Object operations
getObject(bucketName: string, objectName: string, callback: ResultCallback<ReadableStream>): void
getObject(bucketName: string, objectName: string): Promise<ReadableStream>
getObject(
bucketName: string,
objectName: string,
getOpts: GetObjectOpts,
Getcallback: ResultCallback<ReadableStream>,
): void
getObject(bucketName: string, objectName: string, getOpts?: GetObjectOpts): Promise<ReadableStream>

getPartialObject(
bucketName: string,
Expand All @@ -231,10 +241,38 @@ export class Client extends TypedClient {
length: number,
callback: ResultCallback<ReadableStream>,
): void
getPartialObject(bucketName: string, objectName: string, offset: number, length?: number): Promise<ReadableStream>
getPartialObject(
bucketName: string,
objectName: string,
offset: number,
getOpts: GetObjectOpts,
callback: ResultCallback<ReadableStream>,
): void
getPartialObject(
bucketName: string,
objectName: string,
offset: number,
length: number,
getOpts: GetObjectOpts,
callback: ResultCallback<ReadableStream>,
): void
getPartialObject(
bucketName: string,
objectName: string,
offset: number,
length?: number,
getOpts?: GetObjectOpts,
): Promise<ReadableStream>

fGetObject(bucketName: string, objectName: string, filePath: string, callback: NoResultCallback): void
fGetObject(bucketName: string, objectName: string, filePath: string): Promise<void>
fGetObject(
bucketName: string,
objectName: string,
filePath: string,
getOpts: GetObjectOpts,
callback: NoResultCallback,
): void
fGetObject(bucketName: string, objectName: string, filePath: string, getOpts?: GetObjectOpts): Promise<void>

putObject(
bucketName: string,
Expand Down Expand Up @@ -353,7 +391,7 @@ export class Client extends TypedClient {
getObjectTagging(
bucketName: string,
objectName: string,
getOptions: VersionIdentification,
getOptions: GetObjectOpts,
callback: ResultCallback<Tag[]>,
): void
getObjectTagging(bucketName: string, objectName: string, getOptions?: VersionIdentification): Promise<Tag[]>
Expand Down

0 comments on commit 73d8027

Please sign in to comment.