This repository contains the type definitions for Nintex Form plugins written in TypeScript.
For more information about Nintex Form plugins, see the Software Development Kit.
Install the @nintex/form-plugin-contract
package using npm:
npm install @nintex/form-plugin-contract
In your TypeScript project, import the types as follows:
import { PluginContract, PropType as PluginProperty } from '@nintex/form-plugin-contract';
// Use the PluginProperty type to define custom properties for your plugin
const customProp: PluginProperty = {
type: 'string',
title: 'Custom Property',
description: 'This is a custom property',
};
// Use the PluginContract type to define the contract for your Nintex Form plugin
const plugin: PluginContract = {
version: '1.0',
fallbackDisableSubmit: false,
controlName: 'Example Plugin',
properties: {
customProp,
exampleProp: {
type: 'string',
title: 'Example Property',
description: 'This is an example property',
defaultValue: 'Hello, world!',
required: true
},
},
};
Use zod schema to validate your plugin:
import { pluginContractSchema } from '@nintex/form-plugin-contract';
const pluginData = {
version: '1.0.0',
fallbackDisableSubmit: true,
controlName: 'example-control',
widgetTooltip: 'Example control tooltip',
pluginAuthor: 'John Doe',
pluginVersion: '1.0.0',
searchTerms: ['example', 'control'],
description: 'This is an example control',
groupName: 'Example Group',
iconUrl: 'https://example.com/icon.png',
properties: {
exampleProp: {
type: 'string',
title: 'Example Prop',
description: 'This is an example property',
defaultValue: 'Default value',
format: 'uppercase',
isValueField: true,
},
},
standardProperties: {
fieldLabel: true,
toolTip: true,
description: true,
placeholder: true,
defaultValue: true,
visibility: true,
readOnly: true,
required: true,
},
events: ['exampleEvent'],
};
// Validate the plugin data against the pluginContractSchema
const validatedData = pluginContractSchema.validate(pluginData);
console.log(validatedData);
This project is licensed under the Apache License, Version 2.0. See LICENSE for details.