Typescript definition for UI5 Tooling
Includes definitions for
Add the package with npm
npm i -D git+https://github.com/todm/ui5-tooling-types.git
Add the types to your ts-config file
{ 'compilerOptions': {
# ...
'types': ['ui5-tooling-types']
} }
If you don't use typescript you can also reference the types in your .js
files.
/// <reference types="ui5-tooling-types" />
// ...
// task.ts
import { TaskFunction } from '@ui5/builder';
const task: TaskFunction = ({ workspace, options }) => {
// workspace and options will have the correct types
};
module.exports = task;
// middleware.ts
import { MiddlewareFunction } from '@ui5/server';
const middleware: MiddlewareFunction = ({ resources, options }) => {
// resources and options will have the correct types
return (req, res, next) => {
// req, res and next will have the correct types as well
};
};
module.exports = middleware;