export type { SecretStore, SecretStoreDeps } from './types.js';
export { FileSecretStore } from './file-store.js';
export { GnomeKeyringStore } from './gnome-keyring.js';
export type { GnomeKeyringDeps, RunCommand } from './gnome-keyring.js';

import { GnomeKeyringStore } from './gnome-keyring.js';
import { FileSecretStore } from './file-store.js';
import type { SecretStore, SecretStoreDeps } from './types.js';

export async function createSecretStore(deps?: SecretStoreDeps): Promise<SecretStore> {
  if (await GnomeKeyringStore.isAvailable()) {
    return new GnomeKeyringStore();
  }
  return new FileSecretStore(deps);
}
