This is a sample GitOK plugin developed using TypeScript. Through this example, you can learn how to create GitOK plugins using TypeScript.
- Complete TypeScript type support
- Sample action implementations
- Custom view examples
.
├── dist/ # Compiled JavaScript files
├── src/ # TypeScript source code
│ ├── index.ts # Plugin main entry
│ └── types.ts # TypeScript type definitions
├── views/ # HTML view files
│ ├── calculator.html
│ └── time.html
├── package.json # Project configuration
└── tsconfig.json # TypeScript configuration
pnpm install
pnpm dev
pnpm build
This sample plugin provides three basic features:
- Greeting - Display a welcome message
- Current Time - Show current time (embedded view)
- Calculator - Provide a simple calculator (window view)
The plugin uses TypeScript interfaces to define clear type structures:
-
Plugin
- Main plugin interface -
Action
- Action definition interface -
PluginContext
- Plugin context interface
- Clone the repository
- Install dependencies:
pnpm install
- Build the project:
pnpm build
- Load this plugin in GitOK application
MIT