mirror of
https://github.com/moeru-ai/airi.git
synced 2026-08-14 00:48:06 +00:00
13 lines
450 B
TypeScript
13 lines
450 B
TypeScript
import type { AudioInputSession } from '../../../src/types'
|
|
|
|
/** Writes AIRI settings through the storage owned by the current runtime page. */
|
|
export async function configureStorage(
|
|
runtime: AudioInputSession,
|
|
settings: Record<string, string>,
|
|
): Promise<void> {
|
|
await runtime.runtimePage.evaluate(({ entries }) => {
|
|
for (const [key, value] of Object.entries(entries))
|
|
localStorage.setItem(key, value)
|
|
}, { entries: settings })
|
|
}
|