projection-schema.d.ts 854 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * Projection schema.
  3. */
  4. export type ProjectionSchema = {
  5. [property: string]: boolean | ProjectionSchemaPropertyOptions | undefined;
  6. };
  7. /**
  8. * Projection schema key.
  9. */
  10. export type ProjectionSchemaKey = string | symbol;
  11. /**
  12. * Projection schema factory.
  13. */
  14. export type ProjectionSchemaFactory = () =>
  15. | ProjectionSchema
  16. | ProjectionSchemaKey;
  17. /**
  18. * Projection schema property options.
  19. */
  20. export type ProjectionSchemaPropertyOptions = {
  21. select?: boolean;
  22. scopes?: ProjectionSchemaScopes;
  23. schema?: ProjectionSchema | ProjectionSchemaFactory | ProjectionSchemaKey;
  24. };
  25. /**
  26. * Projection schema scopes.
  27. */
  28. export type ProjectionSchemaScopes = {
  29. [scope: string]: boolean | ProjectionSchemaScopeOptions | undefined;
  30. };
  31. /**
  32. * Projection schema scope options.
  33. */
  34. export type ProjectionSchemaScopeOptions = {
  35. select?: boolean;
  36. };