sourceConfig.d.ts 762 B

1234567891011121314151617181920212223
  1. import type { Source } from '@/source'
  2. import bookSourceEditConfig from './bookSourceEditConfig'
  3. import rssSourceEditConfig from './rssSourceEditConfig'
  4. type PickAnyValueKey<T> = {
  5. [K in keyof T]: T[K] extends { [prop: string]: string } ? K : never
  6. }
  7. type b = keyof PickAnyValueKey<BookSoure>
  8. type SourceConfigKey =
  9. | keyof typeof bookSourceEditConfig
  10. | keyof typeof rssSourceEditConfig
  11. type SourceConfigRecord = {
  12. title: string
  13. type: string //"array" | "String" | "Boolean"
  14. array?: string[]
  15. hint?: string
  16. required?: boolean
  17. namespace?: Partial<keyof Source>
  18. id: Partial<keyof Source>
  19. }
  20. type SourceConfigValue = { name: string; children: SourceConfigRecord[] }
  21. export type SourceConfig = Partial<Record<SourceConfigKey, SourceConfigValue>>