|
|
@@ -26,9 +26,9 @@ your VendureConfig.
|
|
|
```ts title="Signature"
|
|
|
interface AssetStorageStrategy extends InjectableStrategy {
|
|
|
writeFileFromBuffer(fileName: string, data: Buffer): Promise<string>;
|
|
|
- writeFileFromStream(fileName: string, data: Stream): Promise<string>;
|
|
|
+ writeFileFromStream(fileName: string, data: Stream, encoding?: BufferEncoding | null): Promise<string>;
|
|
|
readFileToBuffer(identifier: string): Promise<Buffer>;
|
|
|
- readFileToStream(identifier: string): Promise<Stream>;
|
|
|
+ readFileToStream(identifier: string, encoding?: BufferEncoding | null): Promise<Stream>;
|
|
|
deleteFile(identifier: string): Promise<void>;
|
|
|
fileExists(fileName: string): Promise<boolean>;
|
|
|
toAbsoluteUrl?(request: Request, identifier: string): string;
|
|
|
@@ -48,10 +48,12 @@ Writes a buffer to the store and returns a unique identifier for that
|
|
|
file such as a file path or a URL.
|
|
|
### writeFileFromStream
|
|
|
|
|
|
-<MemberInfo kind="method" type={`(fileName: string, data: Stream) => Promise<string>`} />
|
|
|
+<MemberInfo kind="method" type={`(fileName: string, data: Stream, encoding?: BufferEncoding | null) => Promise<string>`} />
|
|
|
|
|
|
Writes a readable stream to the store and returns a unique identifier for that
|
|
|
file such as a file path or a URL.
|
|
|
+
|
|
|
+Passing null as the encoding will result in no specific encoding being used.
|
|
|
### readFileToBuffer
|
|
|
|
|
|
<MemberInfo kind="method" type={`(identifier: string) => Promise<Buffer>`} />
|
|
|
@@ -60,10 +62,12 @@ Reads a file based on an identifier which was generated by the writeFile
|
|
|
method, and returns the as a Buffer.
|
|
|
### readFileToStream
|
|
|
|
|
|
-<MemberInfo kind="method" type={`(identifier: string) => Promise<Stream>`} />
|
|
|
+<MemberInfo kind="method" type={`(identifier: string, encoding?: BufferEncoding | null) => Promise<Stream>`} />
|
|
|
|
|
|
Reads a file based on an identifier which was generated by the writeFile
|
|
|
method, and returns the file as a Stream.
|
|
|
+
|
|
|
+Passing null as the encoding will result in no specific encoding being used.
|
|
|
### deleteFile
|
|
|
|
|
|
<MemberInfo kind="method" type={`(identifier: string) => Promise<void>`} />
|