Generate docstrings and better API reference docs (#1922)

This commit is contained in:
Josh Mock
2023-06-27 11:51:11 -05:00
committed by GitHub
parent 0b9be7c179
commit 960dff37f2
83 changed files with 7779 additions and 495 deletions

View File

@ -94,6 +94,7 @@ import SlmApi from './api/slm'
import SnapshotApi from './api/snapshot'
import SqlApi from './api/sql'
import SslApi from './api/ssl'
import SynonymsApi from './api/synonyms'
import TasksApi from './api/tasks'
import termsEnumApi from './api/terms_enum'
import termvectorsApi from './api/termvectors'
@ -175,6 +176,7 @@ export default interface API {
snapshot: SnapshotApi
sql: SqlApi
ssl: SslApi
synonyms: SynonymsApi
tasks: TasksApi
termsEnum: typeof termsEnumApi
termvectors: typeof termvectorsApi
@ -216,6 +218,7 @@ const kSlm = Symbol('Slm')
const kSnapshot = Symbol('Snapshot')
const kSql = Symbol('Sql')
const kSsl = Symbol('Ssl')
const kSynonyms = Symbol('Synonyms')
const kTasks = Symbol('Tasks')
const kTextStructure = Symbol('TextStructure')
const kTransform = Symbol('Transform')
@ -252,6 +255,7 @@ export default class API {
[kSnapshot]: symbol | null
[kSql]: symbol | null
[kSsl]: symbol | null
[kSynonyms]: symbol | null
[kTasks]: symbol | null
[kTextStructure]: symbol | null
[kTransform]: symbol | null
@ -287,6 +291,7 @@ export default class API {
this[kSnapshot] = null
this[kSql] = null
this[kSsl] = null
this[kSynonyms] = null
this[kTasks] = null
this[kTextStructure] = null
this[kTransform] = null
@ -428,6 +433,9 @@ Object.defineProperties(API.prototype, {
ssl: {
get () { return this[kSsl] === null ? (this[kSsl] = new SslApi(this.transport)) : this[kSsl] }
},
synonyms: {
get () { return this[kSynonyms] === null ? (this[kSynonyms] = new SynonymsApi(this.transport)) : this[kSynonyms] }
},
tasks: {
get () { return this[kTasks] === null ? (this[kTasks] = new TasksApi(this.transport)) : this[kTasks] }
},