1 | import { DataType } from './data-types';
|
2 | import { Model, WhereOptions } from './model';
|
3 |
|
4 | export type Primitive = 'string' | 'number' | 'boolean';
|
5 |
|
6 | export interface Inflector {
|
7 | singularize(str: string): string;
|
8 | pluralize(str: string): string;
|
9 | }
|
10 |
|
11 | export function useInflection(inflection: Inflector): void;
|
12 |
|
13 | export function camelizeIf(string: string, condition?: boolean): string;
|
14 | export function underscoredIf(string: string, condition?: boolean): string;
|
15 | export function isPrimitive(val: unknown): val is Primitive;
|
16 |
|
17 |
|
18 | export function mergeDefaults<T>(a: T, b: Partial<T>): T;
|
19 | export function spliceStr(str: string, index: number, count: number, add: string): string;
|
20 | export function camelize(str: string): string;
|
21 | export function format(arr: string[], dialect: string): string;
|
22 | export function formatNamedParameters(sql: string, parameters: {
|
23 | [key: string]: string | number | boolean;
|
24 | }, dialect: string): string;
|
25 | export function cloneDeep<T>(obj: T, fn?: (el: unknown) => unknown): T;
|
26 |
|
27 | export interface OptionsForMapping {
|
28 | attributes?: string[];
|
29 | where?: WhereOptions;
|
30 | }
|
31 |
|
32 |
|
33 | export function mapFinderOptions<T extends OptionsForMapping>(options: T, model: typeof Model): T;
|
34 |
|
35 |
|
36 | export function mapOptionFieldNames<T extends OptionsForMapping>(options: T, model: typeof Model): T;
|
37 |
|
38 | export function mapWhereFieldNames(attributes: object, model: typeof Model): object;
|
39 |
|
40 | export function mapValueFieldNames(dataValues: object, fields: string[], model: typeof Model): object;
|
41 |
|
42 | export function isColString(value: string): boolean;
|
43 | export function canTreatArrayAsAnd(arr: unknown[]): boolean;
|
44 | export function combineTableNames(tableName1: string, tableName2: string): string;
|
45 |
|
46 | export function singularize(s: string): string;
|
47 | export function pluralize(s: string): string;
|
48 |
|
49 | export function toDefaultValue<T>(value: unknown): unknown;
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | export function defaultValueSchemable(hash: DataType): boolean;
|
58 | export function stack(): NodeJS.CallSite[];
|
59 | export function now(dialect: string): Date;
|
60 |
|
61 |
|
62 |
|
63 | export const TICK_CHAR: string;
|
64 | export function addTicks(s: string, tickChar?: string): string;
|
65 | export function removeTicks(s: string, tickChar?: string): string;
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 | export function classToInvokable<T extends new (...args: any[]) => any>(ctor: T): T & {
|
72 | (...args: ConstructorParameters<T>): T;
|
73 | }
|
74 |
|
75 | export class SequelizeMethod {
|
76 |
|
77 | }
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | export class Fn extends SequelizeMethod {
|
84 | constructor(fn: string, args: unknown[]);
|
85 | public clone(): this;
|
86 | }
|
87 |
|
88 | export class Col extends SequelizeMethod {
|
89 | public col: string;
|
90 | constructor(col: string);
|
91 | }
|
92 |
|
93 | export class Cast extends SequelizeMethod {
|
94 | public val: unknown;
|
95 | public type: string;
|
96 | constructor(val: unknown, type?: string);
|
97 | }
|
98 |
|
99 | export class Literal extends SequelizeMethod {
|
100 | public val: unknown;
|
101 | constructor(val: unknown);
|
102 | }
|
103 |
|
104 | export class Json extends SequelizeMethod {
|
105 | public conditions: object;
|
106 | public path: string;
|
107 | public value: string | number | boolean;
|
108 | constructor(conditionsOrPath: string | object, value?: string | number | boolean);
|
109 | }
|
110 |
|
111 | export class Where extends SequelizeMethod {
|
112 | public attribute: object;
|
113 | public comparator: string;
|
114 | public logic: string | object;
|
115 | constructor(attr: object, comparator: string, logic: string | object);
|
116 | constructor(attr: object, logic: string | object);
|
117 | }
|
118 |
|
119 | export { Promise } from './promise';
|