Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
registerModal(name, arg, defaults) {
const id = buildName(pilet, name);
context.registerModal(id, {
pilet,
name,
component: withApi(context.converters, arg, api, 'modal'),
defaults,
});
},
unregisterModal(name) {
function toChild(content: SearchResultType, api: PiletApi, context: GlobalStateContext): ReactChild {
if (typeof content === 'string' || isValidElement(content)) {
return content;
} else {
const component = withApi(context.converters, content, api, 'extension');
return createElement(component);
}
}
registerMenu(name, arg, settings?) {
if (typeof name !== 'string') {
settings = arg;
arg = name;
name = next++;
}
const id = buildName(pilet, name);
context.registerMenuItem(id, {
pilet,
component: withApi(context.converters, arg, api, 'menu'),
settings: getSettings(defaultSettings, settings),
});
},
unregisterMenu(name) {
registerTile(name, arg, preferences?) {
if (typeof name !== 'string') {
preferences = arg;
arg = name;
name = next++;
}
const id = buildName(pilet, name);
context.registerTile(id, {
pilet,
component: withApi(context.converters, arg, api, 'tile'),
preferences: getPreferences(defaultPreferences, preferences),
});
},
unregisterTile(name) {