[package]
name = "matrix-sdk-indexeddb"
version = "0.16.0"
repository = "https://github.com/matrix-org/matrix-rust-sdk"
description = "Web's IndexedDB Storage backend for matrix-sdk"
license = "Apache-2.0"
edition = "2024"
rust-version.workspace = true
readme = "README.md"

[package.metadata.docs.rs]
all-features = true
default-target = "wasm32-unknown-unknown"
rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]

[features]
default = ["e2e-encryption", "state-store", "event-cache-store", "media-store"]
event-cache-store = ["dep:matrix-sdk-base", "media-store", "indexed-type-serializer"]
media-store = ["dep:matrix-sdk-base", "indexed-type-serializer"]
state-store = ["dep:matrix-sdk-base", "growable-bloom-filter", "safe-encode-traits"]
e2e-encryption = ["dep:matrix-sdk-base", "dep:matrix-sdk-crypto", "safe-encode-serializer"]
safe-encode-traits = []
safe-encode-serializer = ["dep:matrix-sdk-crypto", "safe-encode-traits"]
indexed-type-serializer = ["safe-encode-serializer"]
testing = ["matrix-sdk-crypto?/testing"]
experimental-encrypted-state-events = [
    "matrix-sdk-crypto?/experimental-encrypted-state-events"
]
experimental-push-secrets = [
    "matrix-sdk-crypto?/experimental-push-secrets"
]

[dependencies]
async-trait.workspace = true
base64.workspace = true
futures-util.workspace = true
gloo-utils.workspace = true
growable-bloom-filter = { workspace = true, optional = true }
hkdf.workspace = true
indexed_db_futures = { workspace = true, features = [
    "serde",
    "cursors",
    "indices",
    "streams",
]}
js-sys.workspace = true
matrix-sdk-base = { workspace = true, features = ["js"], optional = true }
matrix-sdk-crypto = { workspace = true, features = ["js"], optional = true }
matrix-sdk-store-encryption.workspace = true
rmp-serde.workspace = true
ruma.workspace = true
serde.workspace = true
serde-wasm-bindgen = { version = "0.6.5", default-features = false }
serde_json.workspace = true
sha2.workspace = true
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
uuid = { workspace = true, features = ["js", "serde", "v4"] }
wasm-bindgen.workspace = true
web-sys = { workspace = true, features = ["IdbKeyRange"] }
zeroize.workspace = true

[target.'cfg(target_family = "wasm")'.dependencies]
# for wasm32 we need to activate this
getrandom = { workspace = true, features = ["wasm_js"] }

[dev-dependencies]
assert_matches.workspace = true
assert_matches2.workspace = true
gloo-timers = { workspace = true, features = ["futures"] }
matrix-sdk-base = { workspace = true, features = ["testing"] }
matrix-sdk-common = { workspace = true, features = ["js"] }
matrix-sdk-crypto = { workspace = true, features = ["js", "testing"] }
matrix-sdk-test.workspace = true
rand.workspace = true
tracing-subscriber = { workspace = true, features = [
    "registry",
    "tracing-log",
] }
wasm-bindgen-test.workspace = true
web-sys = { workspace = true, features = [
    "IdbKeyRange",
    "Window",
    "Performance",
] }

[lints]
workspace = true
