Commit 9d404beb authored by rockyl's avatar rockyl

强化提示功能

parent 6730a9ec
......@@ -35,12 +35,30 @@ exports.start = function (options) {
let propsCodeLines = [];
for (let key in props) {
const {alias, type, enum: enumValues, default: defaultValue} = props[key];
let typeStr = 'string';
switch (type) {
case 'enum':
typeStr = enumValues.map(item => `'${item}'`).join('|');
break;
case 'color':
case 'asset':
break;
case 'node':
typeStr = 'NodeClass';
break;
case 'dynamic':
case 'map':
typeStr = 'any';
break;
default:
typeStr = type;
}
propsCodeLines.push(` //${alias}
${key}: ${type};
${key}: ${typeStr};
`);
}
let outputsStr = output.map(item=>`'${item}'`).join('|');
let outputsStr = output.map(item => `'${item}'`).join('|');
let nextTypes = `declare function next(type: ${outputsStr}, payload?: any);`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment