-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b559cdb
commit 76b43e9
Showing
25 changed files
with
167 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
import { permissionDescriptions } from "@kksh/api/ui/permissions" | ||
import { clipboard } from "@kksh/api/ui/worker" | ||
const methodNames = Object.keys(clipboard) | ||
// const permissions = Object.entries(permissionDescriptions) | ||
--- | ||
|
||
<!-- <pre>{JSON.stringify(permissionDescriptions, null, 2)}</pre> --> | ||
|
||
{ | ||
methodNames.map((name) => ( | ||
<li> | ||
<code>{name}</code>: <span>{permissionDescriptions[name]}</span> | ||
</li> | ||
)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
import { Button } from "@kksh/react" | ||
import { Button as Btn } from "@kksh/react" | ||
--- | ||
|
||
<Button client:only="react">Hello Kunkun!</Button> | ||
<Btn client:only="react">Hello Kunkun!</Btn> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
--- | ||
title: Storage API | ||
description: Jarvis Storage API | ||
title: Storage | ||
sidebar: | ||
hidden: true | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,44 @@ | ||
--- | ||
title: Clipboard API | ||
title: Clipboard | ||
sidebar: | ||
badge: | ||
text: WIP | ||
variant: caution | ||
--- | ||
|
||
import ClipboardAPI from '@/components/api/clipboard.astro' | ||
|
||
The clipboard API is the same for `@kksh/api/UI/iframe` and `@kksh/api/ui/worker`. | ||
|
||
## Clipboard API Methods | ||
|
||
|
||
<ClipboardAPI /> | ||
|
||
|
||
## Sample Usage | ||
|
||
```ts | ||
// Check if the clipboard has data | ||
const hasFiles: boolean = await clipboard.hasFiles() | ||
const hasHTML: boolean = await clipboard.hasHTML() | ||
const hasImage: boolean = await clipboard.hasImage() | ||
const hasRTF: boolean = await clipboard.hasRTF() | ||
const hasText: boolean = await clipboard.hasText() | ||
|
||
// Read data from the clipboard | ||
const text: string = await clipboard.readText() | ||
const imageBinary: Blob = await clipboard.readImageBinary('Blob') as Blob | ||
const imageBase64: string = await clipboard.readImageBase64() | ||
const html: string = await clipboard.readHtml() | ||
const files: string[] = await clipboard.readFiles() | ||
const rtf: string = await clipboard.readRtf() | ||
|
||
// Write data to the clipboard | ||
await clipboard.writeText('Hello, World!') | ||
await clipboard.writeImageBinary(Array.from(new Uint8Array(await imageBinary.arrayBuffer()))); | ||
await clipboard.writeHtmlAndText('<h1>Hello, World!</h1>', 'Hello, World!') | ||
await clipboard.writeFiles(['file1.txt', 'file2.txt']) | ||
await clipboard.writeRtf(rtf) | ||
await clipboard.writeImageBase64(imageBase64) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Database API | ||
title: Database | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Dialog API | ||
title: Dialog | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
--- | ||
title: Event API | ||
title: Event | ||
sidebar: | ||
badge: | ||
text: WIP | ||
variant: caution | ||
--- | ||
|
||
|
||
## API Permission Map | ||
|
||
- `onDragDrop`: `"event:drag-drop"` | ||
- `onDragEnter`: `"event:drag-enter"` | ||
- `onDragLeave`: `"event:drag-leave"` | ||
- `onDragOver`: `"event:drag-over"` | ||
- `onWindowBlur`: `"event:window-blur"` | ||
- `onWindowCloseRequested`: `"event:window-close-requested"` | ||
- `onWindowFocus`: `"event:window-focus"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Fetch API | ||
title: Fetch | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: File System API | ||
title: File System | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Log API | ||
title: Log | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Network API | ||
title: Network | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Notification API | ||
title: Notification | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Open API | ||
title: Open | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: OS API | ||
title: OS | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Path API | ||
title: Path | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Shell API | ||
title: Shell | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: System Info API | ||
title: System Info | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: System API | ||
title: System | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Toast API | ||
title: Toast | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: UI API | ||
title: UI | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
title: Updownload API | ||
title: Updownload | ||
description: Download and upload files | ||
sidebar: | ||
badge: | ||
text: WIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.