refactor: ref docs
This commit is contained in:
parent
b51bb9845c
commit
0d824fb203
47
docs/docs/reference/01_init.md
Normal file
47
docs/docs/reference/01_init.md
Normal file
@ -0,0 +1,47 @@
|
||||
---
|
||||
title: "init"
|
||||
---
|
||||
|
||||
`init` is the main entrypoint for mounting your application and its custom logic. It is a reserved function that Jan will look for to initialize your application.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// javascript
|
||||
const core = require("@janhq/core");
|
||||
|
||||
// typescript
|
||||
import * as core from "@janhq/core";
|
||||
```
|
||||
|
||||
## init
|
||||
|
||||
TODO
|
||||
|
||||
## RegisterExtensionPoint
|
||||
|
||||
`RegisterExtensionPoint` is used for app initialization.
|
||||
|
||||
It lets you register functions/methods with the main application.
|
||||
|
||||
```js
|
||||
import { RegisterExtensionPoint } from "@janhq/core";
|
||||
```
|
||||
|
||||
```js
|
||||
type RegisterExtensionPoint = (
|
||||
extensionName: string,
|
||||
extensionId: string,
|
||||
method: Function,
|
||||
priority?: number
|
||||
)
|
||||
```
|
||||
|
||||
## invokePluginFunc
|
||||
|
||||
```js
|
||||
// index.ts
|
||||
function foo(id: number) {
|
||||
return core.invokePluginFunc(MODULE_PATH, "getConvMessages", id);
|
||||
}
|
||||
```
|
||||
@ -1,5 +1,4 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
title: "CoreService"
|
||||
---
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
title: "events"
|
||||
---
|
||||
|
||||
15
docs/docs/reference/04_store.md
Normal file
15
docs/docs/reference/04_store.md
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "store"
|
||||
---
|
||||
|
||||
`store` is a helper object for working with Jan app's local storage database.
|
||||
|
||||
By default, Jan ships with a [pouchDB](https://pouchdb.com/) client side noSQL db to persist usage state.
|
||||
|
||||
_Note: default `store` logic is from [@data-plugin](https://www.npmjs.com/package/@janhq/data-plugin) which implements `StoreService`._
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import { store } from "@janhq/core";
|
||||
```
|
||||
@ -1,5 +1,4 @@
|
||||
---
|
||||
sidebar_position: 5
|
||||
title: "filesystem"
|
||||
---
|
||||
|
||||
19
docs/docs/reference/06_preferences.md
Normal file
19
docs/docs/reference/06_preferences.md
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
title: "preferences"
|
||||
---
|
||||
|
||||
`preferences` is a helper object for adding settings fields to your apps.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
todo;
|
||||
```
|
||||
|
||||
## registerPreferences
|
||||
|
||||
## get
|
||||
|
||||
## set
|
||||
|
||||
## clear
|
||||
@ -1,6 +0,0 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
title: "preferences"
|
||||
---
|
||||
|
||||
## Usage
|
||||
@ -1,15 +0,0 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
title: "store"
|
||||
---
|
||||
|
||||
`store` is a helper library for working with Jan app's local storage database.
|
||||
|
||||
Jan ships with a [pouchDB](https://pouchdb.com/) client side noSQL db to persist usage state
|
||||
store (logic from @data-plugin which implements StoreService)
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import { store } from "@janhq/core";
|
||||
```
|
||||
@ -63,7 +63,7 @@ const sidebars = {
|
||||
type: "category",
|
||||
label: "Reference",
|
||||
collapsible: true,
|
||||
collapsed: false,
|
||||
collapsed: true,
|
||||
items: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user