Skip to content

Commit

Permalink
export types
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyn committed Nov 6, 2024
1 parent 87b3343 commit 464b61a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@
"dynamoose",
"serializers",
"unmarshall"
]
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "never",
"source.fixAll.ts": "never",
"source.organizeImports": "never"
},
}
12 changes: 6 additions & 6 deletions packages/dynamoose/lib/Model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import {Instance} from "../Instance";
import returnModel from "../utils/dynamoose/returnModel";
const {internalProperties} = Internal.General;

type UpdatePartial<T> =
| Partial<T>
| { $SET: Partial<T> }
| { $ADD: Partial<T> }
| { $REMOVE: Partial<T> }
| { $DELETE: Partial<T> };
export type UpdatePartial<T> = Partial<T> & {
$SET?: Partial<T>;
$ADD?: Partial<T>;
$REMOVE?: Partial<T> | string[];
$DELETE?: Partial<T>;
};

// Transactions
type GetTransactionResult = Promise<GetTransactionInput>;
Expand Down
14 changes: 7 additions & 7 deletions packages/dynamoose/lib/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ const attributeTypes: (DynamoDBTypeResult | DynamoDBSetTypeResult)[] = utils.arr

type GeneralValueType = string | boolean | number | Buffer | Date;
export type ValueType = GeneralValueType | {[key: string]: ValueType} | ValueType[];
type AttributeType = string | StringConstructor | BooleanConstructor | NumberConstructor | typeof Buffer | DateConstructor | ObjectConstructor | ArrayConstructor | SetConstructor | symbol | Schema | ModelType<Item>;
export type AttributeType = string | StringConstructor | BooleanConstructor | NumberConstructor | typeof Buffer | DateConstructor | ObjectConstructor | ArrayConstructor | SetConstructor | symbol | Schema | ModelType<Item>;

export interface TimestampObject {
createdAt?: string | string[] | SchemaDefinition;
updatedAt?: string | string[] | SchemaDefinition;
}
interface SchemaSettings {
export interface SchemaSettings {
timestamps?: boolean | TimestampObject;
saveUnknown?: boolean | string[];
set?: (value: ObjectType) => ObjectType;
Expand All @@ -296,7 +296,7 @@ export enum IndexType {
*/
local = "local"
}
interface IndexDefinition {
export interface IndexDefinition {
/**
* The name of the index.
* @default `${attribute}${type == "global" ? "GlobalIndex" : "LocalIndex"}`
Expand All @@ -322,14 +322,14 @@ interface IndexDefinition {
*/
throughput?: "ON_DEMAND" | number | {read: number; write: number};
}
interface AttributeDefinitionTypeSettings {
export interface AttributeDefinitionTypeSettings {
storage?: "milliseconds" | "seconds" | "iso";
model?: ModelType<Item>;
attributes?: string[];
separator?: string;
value?: string | boolean | number;
}
interface AttributeDefinition {
export interface AttributeDefinition {
/**
* The type attribute can either be a type (ex. `Object`, `Number`, etc.) or an object that has additional information for the type. In the event you set it as an object you must pass in a `value` for the type, and can optionally pass in a `settings` object.
*
Expand Down Expand Up @@ -818,10 +818,10 @@ interface AttributeDefinition {
export interface SchemaDefinition {
[attribute: string]: AttributeType | AttributeType[] | AttributeDefinition | AttributeDefinition[];
}
interface SchemaGetAttributeTypeSettings {
export interface SchemaGetAttributeTypeSettings {
unknownAttributeAllowed: boolean;
}
interface SchemaGetAttributeSettingValue {
export interface SchemaGetAttributeSettingValue {
returnFunction: boolean;
typeIndexOptionMap?: any;
}
Expand Down

0 comments on commit 464b61a

Please sign in to comment.