Skip to content

Commit

Permalink
Fix TypeScript types
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Stein <steinlink@gmail.com>
  • Loading branch information
texodus committed Feb 23, 2025
1 parent ce9c9af commit 7c9dc45
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 24 deletions.
5 changes: 0 additions & 5 deletions rust/perspective-js/src/rust/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ use wasm_bindgen::prelude::*;
pub use crate::table::*;
use crate::utils::{inherit_docs, ApiError, ApiResult, JsValueSerdeExt, LocalPollLoop};

#[wasm_bindgen(typescript_custom_section)]
const TS_APPEND_CONTENT: &'static str = r#"
import type {TableInitOptions} from "@finos/perspective";
"#;

#[wasm_bindgen]
extern "C" {
#[derive(Clone)]
Expand Down
10 changes: 5 additions & 5 deletions rust/perspective-js/src/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ export type * from "../../src/ts/ts-rs/ViewOnUpdateResp.d.ts";
export type * from "../../src/ts/ts-rs/OnUpdateOptions.d.ts";
export type * from "../../src/ts/ts-rs/UpdateOptions.d.ts";
import type * as view_window from "../../src/ts/ts-rs/ViewWindow.d.ts";
import type * as table_init_options from "../../src/ts/ts-rs/TableInitOptions.d.ts";
import type * as view_config_update from "../../src/ts/ts-rs/ViewConfigUpdate.d.ts";
import type {ViewWindow} from "../../src/ts/ts-rs/ViewWindow.d.ts";
import type {TableInitOptions} from "../../src/ts/ts-rs/TableInitOptions.d.ts";
import type {ViewConfigUpdate} from "../../src/ts/ts-rs/ViewConfigUpdate.d.ts";
import type * as on_update_args from "../../src/ts/ts-rs/ViewOnUpdateResp.d.ts";
import type * as on_update_options from "../../src/ts/ts-rs/OnUpdateOptions.d.ts";
import type * as update_options from "../../src/ts/ts-rs/UpdateOptions.d.ts";
import type {OnUpdateOptions} from "../../src/ts/ts-rs/OnUpdateOptions.d.ts";
import type {UpdateOptions} from "../../src/ts/ts-rs/UpdateOptions.d.ts";
"#;

#[cfg(feature = "export-init")]
Expand Down
5 changes: 0 additions & 5 deletions rust/perspective-js/src/rust/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,6 @@ impl Table {
}
}

#[wasm_bindgen(typescript_custom_section)]
const TS_APPEND_CONTENT: &'static str = r#"
import type {UpdateOptions, ViewConfigUpdate} from "@finos/perspective";
"#;

#[wasm_bindgen]
extern "C" {
// TODO Fix me
Expand Down
5 changes: 0 additions & 5 deletions rust/perspective-js/src/rust/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ use wasm_bindgen_futures::spawn_local;
use crate::table::Table;
use crate::utils::{inherit_docs, ApiFuture, ApiResult, JsValueSerdeExt, LocalPollLoop};

#[wasm_bindgen(typescript_custom_section)]
const TS_APPEND_CONTENT: &'static str = r#"
import type {OnUpdateOptions, ViewWindow} from "@finos/perspective";
"#;

#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(typescript_type = "ViewWindow")]
Expand Down
14 changes: 10 additions & 4 deletions rust/perspective-viewer/src/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@ use crate::custom_elements::export_dropdown::ExportDropDownMenuElement;
use crate::custom_elements::viewer::PerspectiveViewerElement;
use crate::utils::define_web_component;

// #[wasm_bindgen(typescript_custom_section)]
// const TS_APPEND_CONTENT: &'static str = r#"
// import type * as perspective from "../../dist/wasm/ViewConfigUpdate.ts";
// "#;
#[wasm_bindgen(typescript_custom_section)]
const TS_APPEND_CONTENT: &'static str = r#"
import type {
TableInitOptions,
ViewWindow,
OnUpdateOptions,
UpdateOptions,
ViewConfigUpdate,
} from "@finos/perspective";
"#;

/// Register a plugin globally.
#[wasm_bindgen]
Expand Down
Binary file modified tools/perspective-test/results.tar.gz
Binary file not shown.

0 comments on commit 7c9dc45

Please # to comment.