mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-11 17:29:44 +00:00

* refactor: rename WorkerExtension to TemplateUiCommand, HeadlessWorkerExtension to HeadlessCommand * ci: update npm publish workflow to include refactor branch * ci: add push trigger for JSR publish workflow and bump API package version * ci: add pnpm setup to npm publish workflow * chore: add repository field to package.json for @kksh/api
19 lines
402 B
TypeScript
19 lines
402 B
TypeScript
import { clipboard, expose, HeadlessCommand, toast } from "@kksh/api/headless"
|
|
import { v4 as uuidv4 } from "uuid"
|
|
|
|
class UuidExt extends HeadlessCommand {
|
|
async load() {
|
|
const uuid = uuidv4()
|
|
return clipboard
|
|
.writeText(uuid)
|
|
.then(() => {
|
|
toast.success(`Copied UUID: ${uuid}`)
|
|
})
|
|
.catch((err) => {
|
|
toast.error(`Failed to copy UUID: ${err}`)
|
|
})
|
|
}
|
|
}
|
|
|
|
expose(new UuidExt())
|