fish-desktop-types
v1.2.4
Published
TypeScript type definitions for Fish Desktop Widget components
Maintainers
Readme
@fish-desktop/types
Complete TypeScript type definitions for Fish Desktop Widget components. Get full IntelliSense support and type checking for all Fish components in your TypeScript projects.
Features
✅ Complete Type Coverage - All Fish Desktop Widget components
✅ Auto-generated - Types are automatically generated from official API documentation
✅ IDE IntelliSense - Full autocomplete and parameter hints
✅ Type Safety - Catch errors at compile time
✅ Zero Configuration - Just install and use
Installation
npm install @fish-desktop/typesOr with yarn:
yarn add @fish-desktop/typesUsage
Basic Setup
Simply import the types package in your TypeScript file:
import '@fish-desktop/types';
// Now you have full type support for all Fish components
$('.my-form').form({
// IntelliSense will show all available options
beforeSubmit: data => {
// Full type checking for parameters
console.log(data);
return true;
},
clearForm: true,
dataType: 'json',
});
$('.my-grid').grid({
// Full type support for grid configuration
colNames: ['ID', 'Name', 'Email'],
colModel: [
{ name: 'id', index: 'id', width: 80 },
{ name: 'name', index: 'name', width: 200 },
{ name: 'email', index: 'email', width: 300 },
],
datatype: 'json',
height: 400,
});Method Calls with Type Safety
// Form methods with full parameter type checking
$('.my-form').form('ajaxSubmit', eventData);
$('.my-form').form('getValue', true); // skipNullField parameter
$('.my-form').form('clear'); // No parameters needed
// Grid methods with full parameter type checking
$('.my-grid').grid('addRowData', 'new-row-id', rowData, 'last');
$('.my-grid').grid('setSelection', 'row-id', true);
$('.my-grid').grid('getRowData', 'row-id');TypeScript Configuration
Make sure your tsconfig.json includes the types:
{
"compilerOptions": {
"types": ["@fish-desktop/types"],
"moduleResolution": "node"
}
}Supported Components
| Component | Status | Methods | Events | Config Options | | --------- | ------ | ------- | ------ | -------------- | | Form | ✅ | 9 | 1 | 14 | | Grid | ✅ | 100+ | 20+ | 100+ |
Component Documentation
Form Component
The Form component provides AJAX form submission and validation capabilities.
Key Methods:
ajaxSubmit()- Submit form via AJAXgetValue()- Get form values as objectclear()- Clear all form fieldsdisable()/enable()- Control form state
Configuration Options:
beforeSubmit- Callback before form submissionsuccess- Success callbackdataType- Response data typevalidate- Validation settings
Grid Component
The Grid component provides powerful data grid functionality with sorting, paging, and editing.
Key Methods:
addRowData()- Add new rowdelRowData()- Delete rowgetRowData()- Get row datasetSelection()- Select rowreloadData()- Reload grid data
Configuration Options:
colModel- Column model definitiondatatype- Data source typepager- Pagination settingssortname- Default sort column
Development
This package is auto-generated from Fish Desktop Widget API documentation. The types are kept up-to-date with the latest component versions.
Building from Source
# Clone the repository
git clone https://github.com/fish-desktop/types.git
cd types
# Install dependencies
npm install
# Generate types (if you have the source documentation)
npm run generateContributing
Found a bug or missing type definition? Please open an issue or submit a pull request.
License
MIT © Fish Desktop Widget Team
Changelog
1.0.0
- Initial release
- Form component type definitions
- Grid component type definitions
- Full method parameter type support
- Event handler type definitions
