Skip to content

Commit

Permalink
blob: set up auto-generated API docs (#14286)
Browse files Browse the repository at this point in the history
  • Loading branch information
nosolosw authored and youknowriad committed Mar 20, 2019
1 parent 99d5a85 commit 4e2b7d1
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/update-readmes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const childProcess = require( 'child_process' );
const packages = [
'a11y',
//'autop',
//'blob',
'blob',
//'block-editor',
//'block-library',
//'block-serialization-default-parser',
Expand Down
61 changes: 61 additions & 0 deletions packages/blob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,65 @@ Install the module
npm install @wordpress/blob --save
```

## API

<!-- START TOKEN(Autogenerated API docs) -->

### 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.


<!-- END TOKEN(Autogenerated API docs) -->

<br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>

0 comments on commit 4e2b7d1

Please sign in to comment.