From a2761c8c67de6b90db44d954ea8d85d886669d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Thu, 7 Mar 2019 09:00:57 +0100 Subject: [PATCH] blob: set up auto-generated API docs (#14286) --- bin/update-readmes.js | 2 +- packages/blob/README.md | 61 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/bin/update-readmes.js b/bin/update-readmes.js index 9bb32bd7c9e08a..91be89cd2912cf 100755 --- a/bin/update-readmes.js +++ b/bin/update-readmes.js @@ -6,7 +6,7 @@ const childProcess = require( 'child_process' ); const packages = [ 'a11y', //'autop', - //'blob', + 'blob', //'block-editor', //'block-library', //'block-serialization-default-parser', diff --git a/packages/blob/README.md b/packages/blob/README.md index d8f1b1b359aa4b..c0aed95f3b17b9 100644 --- a/packages/blob/README.md +++ b/packages/blob/README.md @@ -10,4 +10,65 @@ Install the module npm install @wordpress/blob --save ``` +## API + + + +### createBlobURL + +[src/index.js#L15-L21](src/index.js#L15-L21) + +Create a blob URL from a file. + +**Parameters** + +- **file** `File`: The file to create a blob URL for. + +**Returns** + +`string`: The blob URL. + +### getBlobByURL + +[src/index.js#L32-L34](src/index.js#L32-L34) + +Retrieve a file based on a blob URL. The file must have been created by +`createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return +`undefined`. + +**Parameters** + +- **url** `string`: The blob URL. + +**Returns** + +`?File`: The file for the blob URL. + +### isBlobURL + +[src/index.js#L56-L61](src/index.js#L56-L61) + +Check whether a url is a blob url. + +**Parameters** + +- **url** `string`: The URL. + +**Returns** + +`boolean`: Is the url a blob url? + +### revokeBlobURL + +[src/index.js#L41-L47](src/index.js#L41-L47) + +Remove the resource and file cache from memory. + +**Parameters** + +- **url** `string`: The blob URL. + + + +

Code is Poetry.