dist/commonjs/adapters/redis.d.ts
Types
SearchOptions
export type SearchOptions = { type: keyof typeof types; between: { from: number; to: number; }; };
Options
export type Options = { client: Redis; mode: MODES; };
SearchResult
type SearchResult = Array<string | number>;
All
import type { Redis } from "ioredis";
import { Adapter } from "../contract/adapter.js";
declare const types: {
intersect: string;
union: string;
and: string;
or: string;
};
export type SearchOptions = {
type: keyof typeof types;
between: {
from: number;
to: number;
};
};
export declare enum MODES {
phonetic = 0,
prefix = 1
}
export type Options = {
client: Redis;
mode: MODES;
};
type SearchResult = Array<string | number>;
export declare class RedisAdapter implements Adapter<SearchOptions, SearchResult> {
#private;
redis: Redis;
index: string;
mode: MODES;
constructor(name: string, options: Options);
set(id: string | number, text: string): Promise<boolean>;
delete(id: string | number): Promise<boolean>;
search(text: string, options?: SearchOptions): Promise<SearchResult>;
}
export {};
//# sourceMappingURL=redis.d.ts.map
All
export { SearchCollection } from "./SearchCollection.js";
//# sourceMappingURL=index.d.ts.map
Types
SearchOptions
export type SearchOptions = { type: keyof typeof types; between: { from: number; to: number; }; };
Options
export type Options = { client: Redis; mode: MODES; };
SearchResult
type SearchResult = Array<string | number>;
All
import type { Redis } from "ioredis";
import { Adapter } from "../contract/adapter.js";
declare const types: {
intersect: string;
union: string;
and: string;
or: string;
};
export type SearchOptions = {
type: keyof typeof types;
between: {
from: number;
to: number;
};
};
export declare enum MODES {
phonetic = 0,
prefix = 1
}
export type Options = {
client: Redis;
mode: MODES;
};
type SearchResult = Array<string | number>;
export declare class RedisAdapter implements Adapter<SearchOptions, SearchResult> {
#private;
redis: Redis;
index: string;
mode: MODES;
constructor(name: string, options: Options);
set(id: string | number, text: string): Promise<boolean>;
delete(id: string | number): Promise<boolean>;
search(text: string, options?: SearchOptions): Promise<SearchResult>;
}
export {};
//# sourceMappingURL=redis.d.ts.map
All
export { SearchCollection } from "./SearchCollection.js";
//# sourceMappingURL=index.d.ts.map