fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at feat/use-query-options 36 lines 903 B view raw
1import type { AnalysisContext, NodeName, Ref } from '@hey-api/codegen-core'; 2import { isNode, isSymbol, ref } from '@hey-api/codegen-core'; 3 4import type { py } from '../../py-compiler'; 5import type { MaybePyDsl } from '../base'; 6import { PyDsl } from '../base'; 7import { ExprMixin } from '../mixins/expr'; 8 9type Id = NodeName | MaybePyDsl<py.Expression>; 10 11const Mixed = ExprMixin(PyDsl<py.Expression>); 12 13export class ExprPyDsl extends Mixed { 14 readonly '~dsl' = 'ExprPyDsl'; 15 16 protected _exprInput: Ref<Id>; 17 18 constructor(id: Id) { 19 super(); 20 this._exprInput = ref(id); 21 if (typeof id === 'string' || isSymbol(id)) { 22 this.name.set(id); 23 } else if (isNode(id)) { 24 this.name.set(id.name); 25 } 26 } 27 28 override analyze(ctx: AnalysisContext): void { 29 super.analyze(ctx); 30 ctx.analyze(this._exprInput); 31 } 32 33 override toAst() { 34 return this.$node(this._exprInput); 35 } 36}