chore: typecheck fixes

This commit is contained in:
Kacper Kula 2025-08-13 11:40:53 +01:00
parent 346e358863
commit fde71f2d73
4 changed files with 12 additions and 16 deletions

View file

@ -1,6 +1,8 @@
import { TFile } from "obsidian";
import { MemoryDatabase } from "./memoryDatabase";
// @ts-ignore
import wasmBinary from '../../../../node_modules/@jlongster/sql.js/dist/sql-wasm.wasm'
// @ts-ignore
import initSqlJs from '@jlongster/sql.js';
export class DatabaseManager {

View file

@ -25,7 +25,8 @@ export const explorer = buildContainer((c) =>
rendererRegistry: RendererRegistry,
plugin: Plugin,
viewPluginGenerator: ViewPluginGeneratorType
}>(),
}>()
.exports('init'),
);
export type ExplorerModule = typeof explorer;

View file

@ -49,16 +49,6 @@ export class SchemaVisualiser {
stroke: '#666',
fill: '#f9f9f9',
fontSize: 12,
// Relationship line styling
relationshipLabelColor: '#333',
relationshipLabelBackground: '#fff',
relationshipLabelBorder: '#666',
// Make relationships more visible
primaryColor: '#4a90e2',
primaryTextColor: '#333',
primaryBorderColor: '#666',
lineColor: '#666',
arrowheadColor: '#666',
// Force full width usage
useMaxWidth: true
},

View file

@ -175,12 +175,15 @@ class UIBuilder {
createInputSection(container: HTMLElement, currentPath: string, isDisabled: boolean): HTMLInputElement {
const inputSection = container.createDiv({ cls: 'sqlseal-json-input-section' });
inputSection.createEl('label', { text: 'JSONPath Query:' });
return inputSection.createEl('input', {
const input = inputSection.createEl('input', {
type: 'text',
value: currentPath,
placeholder: '$.users[*] or $.data.items[?(@.active)]',
disabled: isDisabled
placeholder: '$.users[*] or $.data.items[?(@.active)]'
});
if (isDisabled) {
input.disabled = true;
}
return input;
}
createContentPanels(container: HTMLElement): {
@ -198,7 +201,7 @@ class UIBuilder {
return { jsonContainer, tableContainer };
}
createGenerateCodeButton(container: HTMLElement, onGenerate: () => void): HTMLElement {
createGenerateCodeButton(container: HTMLElement, onGenerate: () => void): HTMLButtonElement {
const buttonContainer = container.createDiv({ cls: 'sqlseal-button-container' });
const buttonComponent = new ButtonComponent(buttonContainer);
@ -340,7 +343,7 @@ export class JsonView extends TextFileView {
}
this.generateCodeButton = this.uiBuilder.createGenerateCodeButton(mainContainer, () => this.generateSQLSealCode());
if (this.isLargeFile && !this.isAnalyzed) {
if (this.isLargeFile && !this.isAnalyzed && this.generateCodeButton) {
this.generateCodeButton.style.display = 'none';
}