Wpis z mikrobloga

#javascript #json #schema #nodejs
Chcę z paczką(lub inną), z tego kodu schema wygenerować declare namespace browser.tabsExtra:

[
{
"namespace": "tabsExtra",
"functions": [
{
"name": "create",
"type": "function",
"description": "tabs.create extra API.",
"async": true,
"parameters": [
{
"name": "createProperties",
"type": "object",
"optional": true,
"properties": {
"url": { "type": "string" },
"active": { "type": "boolean", "optional": true }
}
}
]
},
{
"name": "update",
"type": "function",
"description": "Update tab extra API.",
"async": true,
"parameters": [
{
"name": "url",
"type": "string"
}
]
}
]
}
]

Uzyskać taki kod:

declare namespace browser.tabsExtra {
function create(createProperties: _CreateCreateProperties): Promise;
function update(updateProperties: _UpdateUpdateProperties): Promise;
}

Pomijając typy - chodzi o samo uzyskanie declare namespace browser.tabsExtra {} i wewnątrz to co jest w schema z namespace tabsExtra.

Na razie zwraca mi to:

export interface Browser {
[k: string]: unknown;
}

więc całkiem jestem w d. Pomóżcie cokolwiek ruszyć.