bitwarden_sensitive_value/types.rs
1use crate::SensitiveString;
2
3// A list of secret value type aliases
4/// A master password. Wrapped to prevent accidental logging.
5pub type MasterPassword = SensitiveString;
6/// A PIN. Wrapped to prevent accidental logging.
7pub type Pin = SensitiveString;
8
9// Tsify/wasm-bindgen emit the type alias name verbatim when these are used as fields, so we must
10// declare matching TypeScript types. They are structurally identical to `SensitiveString`.
11#[cfg(feature = "wasm")]
12const _: () = {
13 use wasm_bindgen::prelude::wasm_bindgen;
14
15 #[wasm_bindgen(typescript_custom_section)]
16 const TS_CUSTOM_TYPES: &'static str = r#"
17export type MasterPassword = SensitiveString;
18export type Pin = SensitiveString;
19"#;
20};