projection-schema.d.ts 822 B

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