|
|
@@ -0,0 +1,49 @@
|
|
|
+/**
|
|
|
+ * Projection schema.
|
|
|
+ */
|
|
|
+export type ProjectionSchema =
|
|
|
+ | ProjectionSchemaProperties
|
|
|
+ | ProjectionSchemaFactory
|
|
|
+ | ProjectionSchemaName;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Projection schema factory.
|
|
|
+ */
|
|
|
+export type ProjectionSchemaFactory = (
|
|
|
+ ...args: any[]
|
|
|
+) => ProjectionSchemaProperties | ProjectionSchemaName;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Projection schema name.
|
|
|
+ */
|
|
|
+export type ProjectionSchemaName = string;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Projection schema properties.
|
|
|
+ */
|
|
|
+export type ProjectionSchemaProperties = {
|
|
|
+ [property: string]: boolean | ProjectionSchemaPropertyOptions | undefined;
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * Projection schema property options.
|
|
|
+ */
|
|
|
+export type ProjectionSchemaPropertyOptions = {
|
|
|
+ select?: boolean;
|
|
|
+ scopes?: ProjectionSchemaScopes;
|
|
|
+ schema?: ProjectionSchema;
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * Projection schema scopes.
|
|
|
+ */
|
|
|
+export type ProjectionSchemaScopes = {
|
|
|
+ [scope: string]: boolean | ProjectionSchemaScopeOptions | undefined;
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * Projection schema scope options.
|
|
|
+ */
|
|
|
+export type ProjectionSchemaScopeOptions = {
|
|
|
+ select?: boolean;
|
|
|
+};
|