Represents a database with basic CRUD operations.

interface Database {
    AddOrUpdate: ((key: string, value: any) => void);
    ApplicationName: string;
    Delete: ((key: string) => void);
    Get: ((key: string) => any);
    GetData: ((optionalPrefix: string) => DataBaseEntry[]);
    Keys: ((optionalPrefix: string) => string[]);
}

Properties

AddOrUpdate: ((key: string, value: any) => void)

Adds or updates a value in the database.

Type declaration

    • (key, value): void
    • Parameters

      • key: string

        The key under which to store the value.

      • value: any

        The value to store.

      Returns void

ApplicationName: string

Name of the application using the database.

Delete: ((key: string) => void)

Deletes a value from the database based on the key.

Type declaration

    • (key): void
    • Parameters

      • key: string

        The key to delete the value for.

      Returns void

Get: ((key: string) => any)

Retrieves a value from the database based on the key.

Type declaration

    • (key): any
    • Parameters

      • key: string

        The key to retrieve the value for.

      Returns any

      The value associated with the key.

GetData: ((optionalPrefix: string) => DataBaseEntry[])

Retrieves all database entries optionally filtered by prefix.

Type declaration

    • (optionalPrefix): DataBaseEntry[]
    • Parameters

      • optionalPrefix: string

        Optional prefix to filter entries.

      Returns DataBaseEntry[]

      Array of database entries matching the optional prefix.

Keys: ((optionalPrefix: string) => string[])

Retrieves keys from the database optionally filtered by prefix.

Type declaration

    • (optionalPrefix): string[]
    • Parameters

      • optionalPrefix: string

        Optional prefix to filter keys.

      Returns string[]

      Array of keys matching the optional prefix.