Skip to content

Commit

Permalink
Added the 'finalSize' argument to the 'write(...)' method (= 'Content…
Browse files Browse the repository at this point in the history
…-Length' header)
  • Loading branch information
AdrienCastex committed Jun 19, 2017
1 parent aa8a629 commit 8d4df3e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/resource/IResource.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// <reference types="node" />
import { Readable, Writable } from 'stream';
import { FSManager } from '../manager/FSManager';
import { FSManager, FSPath } from '../manager/FSManager';
import { MethodCallArgs } from '../server/MethodCallArgs';
import { XMLElement } from '../helper/XML';
import { LockKind } from './lock/LockKind';
import { Lock } from './lock/Lock';
Expand All @@ -27,7 +28,7 @@ export interface IResource {
delete(callback: SimpleCallback): any;
moveTo(parent: IResource, newName: string, overwrite: boolean, callback: SimpleCallback): any;
rename(newName: string, callback: Return2Callback<string, string>): any;
write(targetSource: boolean, callback: ReturnCallback<Writable>): any;
write(targetSource: boolean, callback: ReturnCallback<Writable>, finalSize?: number): any;
read(targetSource: boolean, callback: ReturnCallback<Readable>): any;
mimeType(targetSource: boolean, callback: ReturnCallback<string>): any;
size(targetSource: boolean, callback: ReturnCallback<number>): any;
Expand All @@ -48,4 +49,5 @@ export interface IResource {
webName(callback: ReturnCallback<string>): any;
displayName?(callback: ReturnCallback<string>): any;
type(callback: ReturnCallback<ResourceType>): any;
gateway?(arg: MethodCallArgs, path: FSPath, callback: (error: Error, resource?: IResource) => void): any;
}
6 changes: 5 additions & 1 deletion src/resource/IResource.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Readable, Writable } from 'stream'
import { FSManager, FSPath } from '../manager/FSManager'
import { MethodCallArgs } from '../server/MethodCallArgs'
import { XMLElement } from '../helper/XML'
import { LockKind } from './lock/LockKind'
import { LockType } from './lock/LockType'
Expand Down Expand Up @@ -44,7 +45,7 @@ export interface IResource
rename(newName : string, callback : Return2Callback<string, string>)

// ****************************** Content ****************************** //
write(targetSource : boolean, callback : ReturnCallback<Writable>)
write(targetSource : boolean, callback : ReturnCallback<Writable>, finalSize ?: number)
read(targetSource : boolean, callback : ReturnCallback<Readable>)
mimeType(targetSource : boolean, callback : ReturnCallback<string>)
size(targetSource : boolean, callback : ReturnCallback<number>)
Expand Down Expand Up @@ -73,4 +74,7 @@ export interface IResource
webName(callback : ReturnCallback<string>)
displayName?(callback : ReturnCallback<string>)
type(callback : ReturnCallback<ResourceType>)

// ****************************** Gateway ****************************** //
gateway?(arg : MethodCallArgs, path : FSPath, callback : (error : Error, resource ?: IResource) => void)
}

0 comments on commit 8d4df3e

Please sign in to comment.