Fixed building process
parent
c61fe1ca47
commit
ba66c91729
|
@ -29,7 +29,7 @@ namespace bookmarks {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Bookmark {
|
export interface Bookmark {
|
||||||
type: BookmarkType.ENTRY;
|
type: /* BookmarkType.ENTRY */ BookmarkType;
|
||||||
|
|
||||||
/* readonly directory: DirectoryBookmark; */
|
/* readonly directory: DirectoryBookmark; */
|
||||||
server_properties: ServerProperties;
|
server_properties: ServerProperties;
|
||||||
|
@ -44,7 +44,7 @@ namespace bookmarks {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DirectoryBookmark {
|
export interface DirectoryBookmark {
|
||||||
type: BookmarkType.DIRECTORY;
|
type: /* BookmarkType.DIRECTORY */ BookmarkType;
|
||||||
|
|
||||||
readonly content: (Bookmark | DirectoryBookmark)[];
|
readonly content: (Bookmark | DirectoryBookmark)[];
|
||||||
unique_id: string;
|
unique_id: string;
|
||||||
|
@ -93,7 +93,7 @@ namespace bookmarks {
|
||||||
if(entry.unique_id == uuid)
|
if(entry.unique_id == uuid)
|
||||||
return entry;
|
return entry;
|
||||||
if(entry.type == BookmarkType.DIRECTORY) {
|
if(entry.type == BookmarkType.DIRECTORY) {
|
||||||
const result = find_bookmark_recursive(entry, uuid);
|
const result = find_bookmark_recursive(entry as DirectoryBookmark, uuid);
|
||||||
if(result) return result;
|
if(result) return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ namespace bookmarks {
|
||||||
else
|
else
|
||||||
for(const entry of parent.content)
|
for(const entry of parent.content)
|
||||||
if(entry.type == BookmarkType.DIRECTORY)
|
if(entry.type == BookmarkType.DIRECTORY)
|
||||||
delete_bookmark_recursive(entry, bookmark)
|
delete_bookmark_recursive(entry as DirectoryBookmark, bookmark)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function delete_bookmark(bookmark: Bookmark | DirectoryBookmark) {
|
export function delete_bookmark(bookmark: Bookmark | DirectoryBookmark) {
|
||||||
|
|
|
@ -21,9 +21,9 @@ const js_render = window.jsrender || $;
|
||||||
const native_client = window.require !== undefined;
|
const native_client = window.require !== undefined;
|
||||||
|
|
||||||
function getUserMediaFunction() {
|
function getUserMediaFunction() {
|
||||||
if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia)
|
if((navigator as any).mediaDevices && (navigator as any).mediaDevices.getUserMedia)
|
||||||
return (settings, success, fail) => { navigator.mediaDevices.getUserMedia(settings).then(success).catch(fail); };
|
return (settings, success, fail) => { (navigator as any).mediaDevices.getUserMedia(settings).then(success).catch(fail); };
|
||||||
return navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
|
return (navigator as any).getUserMedia || (navigator as any).webkitGetUserMedia || (navigator as any).mozGetUserMedia;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_close() {
|
function setup_close() {
|
||||||
|
|
|
@ -321,11 +321,30 @@ generators[SyntaxKind.ClassDeclaration] = (settings, stack, node: ts.ClassDeclar
|
||||||
return ts.createClassDeclaration(node.decorators, append_export(append_declare(node.modifiers, !stack.flag_declare), stack.flag_namespace), node.name, node.typeParameters, node.heritageClauses, members as any);
|
return ts.createClassDeclaration(node.decorators, append_export(append_declare(node.modifiers, !stack.flag_declare), stack.flag_namespace), node.name, node.typeParameters, node.heritageClauses, members as any);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
generators[SyntaxKind.PropertySignature] = (settings, stack, node: ts.PropertySignature) => {
|
||||||
|
console.log(SyntaxKind[node.type.kind]);
|
||||||
|
let type: ts.TypeNode = node.type;
|
||||||
|
switch (node.type.kind) {
|
||||||
|
case SyntaxKind.LiteralType:
|
||||||
|
type = ts.createIdentifier("any") as any;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ts.createPropertySignature(node.modifiers, node.name, node.questionToken, type, undefined);
|
||||||
|
};
|
||||||
|
|
||||||
generators[SyntaxKind.InterfaceDeclaration] = (settings, stack, node: ts.InterfaceDeclaration) => {
|
generators[SyntaxKind.InterfaceDeclaration] = (settings, stack, node: ts.InterfaceDeclaration) => {
|
||||||
if(settings.remove_private.field && has_private(node.modifiers)) return;
|
if(settings.remove_private.field && has_private(node.modifiers)) return;
|
||||||
if(stack.flag_namespace && !has_modifier(node.modifiers, SyntaxKind.ExportKeyword)) return;
|
if(stack.flag_namespace && !has_modifier(node.modifiers, SyntaxKind.ExportKeyword)) return;
|
||||||
|
|
||||||
return node;
|
const members: any[] = [];
|
||||||
|
for(const member of node.members) {
|
||||||
|
if(generators[member.kind])
|
||||||
|
members.push(generators[member.kind](settings, stack, member));
|
||||||
|
else
|
||||||
|
members.push(member);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ts.createInterfaceDeclaration(undefined, append_export(append_declare(node.modifiers, !stack.flag_declare), stack.flag_namespace), node.name, node.typeParameters, node.heritageClauses, members);
|
||||||
};
|
};
|
||||||
|
|
||||||
generators[SyntaxKind.VariableDeclaration] = (settings, stack, node: ts.VariableDeclaration) => {
|
generators[SyntaxKind.VariableDeclaration] = (settings, stack, node: ts.VariableDeclaration) => {
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
enum YY {
|
||||||
|
H = "C",
|
||||||
|
B = "Y"
|
||||||
|
}
|
||||||
|
|
||||||
|
interface X {
|
||||||
|
type: "",
|
||||||
|
c: YY.B
|
||||||
|
}
|
|
@ -1 +1 @@
|
||||||
Subproject commit 032446b477a5fec8cccc6c3632a0bcbf521b9c0f
|
Subproject commit a48cdd857059ff7640c93fa4f0e226739943e4d9
|
Loading…
Reference in New Issue