index.d.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. export enum TypeId {
  2. BOOL = 16,
  3. BYTEA = 17,
  4. CHAR = 18,
  5. INT8 = 20,
  6. INT2 = 21,
  7. INT4 = 23,
  8. REGPROC = 24,
  9. TEXT = 25,
  10. OID = 26,
  11. TID = 27,
  12. XID = 28,
  13. CID = 29,
  14. JSON = 114,
  15. XML = 142,
  16. PG_NODE_TREE = 194,
  17. SMGR = 210,
  18. PATH = 602,
  19. POLYGON = 604,
  20. CIDR = 650,
  21. FLOAT4 = 700,
  22. FLOAT8 = 701,
  23. ABSTIME = 702,
  24. RELTIME = 703,
  25. TINTERVAL = 704,
  26. CIRCLE = 718,
  27. MACADDR8 = 774,
  28. MONEY = 790,
  29. MACADDR = 829,
  30. INET = 869,
  31. ACLITEM = 1033,
  32. BPCHAR = 1042,
  33. VARCHAR = 1043,
  34. DATE = 1082,
  35. TIME = 1083,
  36. TIMESTAMP = 1114,
  37. TIMESTAMPTZ = 1184,
  38. INTERVAL = 1186,
  39. TIMETZ = 1266,
  40. BIT = 1560,
  41. VARBIT = 1562,
  42. NUMERIC = 1700,
  43. REFCURSOR = 1790,
  44. REGPROCEDURE = 2202,
  45. REGOPER = 2203,
  46. REGOPERATOR = 2204,
  47. REGCLASS = 2205,
  48. REGTYPE = 2206,
  49. UUID = 2950,
  50. TXID_SNAPSHOT = 2970,
  51. PG_LSN = 3220,
  52. PG_NDISTINCT = 3361,
  53. PG_DEPENDENCIES = 3402,
  54. TSVECTOR = 3614,
  55. TSQUERY = 3615,
  56. GTSVECTOR = 3642,
  57. REGCONFIG = 3734,
  58. REGDICTIONARY = 3769,
  59. JSONB = 3802,
  60. REGNAMESPACE = 4089,
  61. REGROLE = 4096
  62. }
  63. export type builtinsTypes =
  64. 'BOOL' |
  65. 'BYTEA' |
  66. 'CHAR' |
  67. 'INT8' |
  68. 'INT2' |
  69. 'INT4' |
  70. 'REGPROC' |
  71. 'TEXT' |
  72. 'OID' |
  73. 'TID' |
  74. 'XID' |
  75. 'CID' |
  76. 'JSON' |
  77. 'XML' |
  78. 'PG_NODE_TREE' |
  79. 'SMGR' |
  80. 'PATH' |
  81. 'POLYGON' |
  82. 'CIDR' |
  83. 'FLOAT4' |
  84. 'FLOAT8' |
  85. 'ABSTIME' |
  86. 'RELTIME' |
  87. 'TINTERVAL' |
  88. 'CIRCLE' |
  89. 'MACADDR8' |
  90. 'MONEY' |
  91. 'MACADDR' |
  92. 'INET' |
  93. 'ACLITEM' |
  94. 'BPCHAR' |
  95. 'VARCHAR' |
  96. 'DATE' |
  97. 'TIME' |
  98. 'TIMESTAMP' |
  99. 'TIMESTAMPTZ' |
  100. 'INTERVAL' |
  101. 'TIMETZ' |
  102. 'BIT' |
  103. 'VARBIT' |
  104. 'NUMERIC' |
  105. 'REFCURSOR' |
  106. 'REGPROCEDURE' |
  107. 'REGOPER' |
  108. 'REGOPERATOR' |
  109. 'REGCLASS' |
  110. 'REGTYPE' |
  111. 'UUID' |
  112. 'TXID_SNAPSHOT' |
  113. 'PG_LSN' |
  114. 'PG_NDISTINCT' |
  115. 'PG_DEPENDENCIES' |
  116. 'TSVECTOR' |
  117. 'TSQUERY' |
  118. 'GTSVECTOR' |
  119. 'REGCONFIG' |
  120. 'REGDICTIONARY' |
  121. 'JSONB' |
  122. 'REGNAMESPACE' |
  123. 'REGROLE';
  124. export type TypesBuiltins = {[key in builtinsTypes]: TypeId};
  125. export type TypeFormat = 'text' | 'binary';
  126. export const builtins: TypesBuiltins;
  127. export function setTypeParser (id: TypeId, parseFn: ((value: string) => any)): void;
  128. export function setTypeParser (id: TypeId, format: TypeFormat, parseFn: (value: string) => any): void;
  129. export const getTypeParser: (id: TypeId, format?: TypeFormat) => any
  130. export const arrayParser: (source: string, transform: (entry: any) => any) => any[];