Skip to content

Commit

Permalink
Adds Fliplet.Widget.find() docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tonytlwu committed Mar 14, 2024
1 parent 5a228e1 commit d04c344
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/API/core/widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

## Core widget APIs

### Find widgets for a page

```js
Fliplet.Widget.find().then(function(instances) {
// Returns all widget instances for a page
});

Fliplet.Widget.find({ package: 'com.fiplet.image' }).then(function(instances) {
// Returns all image widget instances for a page
});

Fliplet.Widget.findOne({ package: 'com.fiplet.image' }).then(function(instance) {
// Returns the first image widget instance found on a page
});
```

### Get the JSON schema of a widget

You can use this method to fetch the JSON schema of a widget. The following widget packages are currently supporting this feature:
Expand Down

0 comments on commit d04c344

Please sign in to comment.