persona-community-5/.pnpm-store/v3/files/2d/a026143df0c30fb6e8ec5b823df3bea94b22f6d55987c036e972b0a57ee9a019fac70247485d968d5cdef12db15748bf0e83deb6379da994921ab06fbd7132
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

28 lines
975 B
Plaintext

import ts from "typescript";
import { tsModifiers, tsPropertyIndex } from "../lib/ts.js";
import { createRef, getEntries } from "../lib/utils.js";
import type { GlobalContext, WebhooksObject } from "../types.js";
import transformPathItemObject from "./path-item-object.js";
export default function transformWebhooksObject(webhooksObject: WebhooksObject, options: GlobalContext): ts.TypeNode {
const type: ts.TypeElement[] = [];
for (const [name, pathItemObject] of getEntries(webhooksObject, options)) {
type.push(
ts.factory.createPropertySignature(
/* modifiers */ tsModifiers({
readonly: options.immutable,
}),
/* name */ tsPropertyIndex(name),
/* questionToken */ undefined,
/* type */ transformPathItemObject(pathItemObject, {
path: createRef(["webhooks", name]),
ctx: options,
}),
),
);
}
return ts.factory.createTypeLiteralNode(type);
}