diff --git a/src/index.js b/src/index.js index d9cc93b1..18dce961 100644 --- a/src/index.js +++ b/src/index.js @@ -22,7 +22,7 @@ import Websocket from './websocket.js'; import WorkerWebsocket from './worker-websocket.js'; import log from './log.js'; import { ElementType, ErrorCondition, LOG_LEVELS, NS, Status, XHTML } from './constants.js'; -import { stx, toStanza } from './stanza.js'; +import { stx, toStanza, Stanza } from './stanza.js'; /** * A container for all Strophe library functions. @@ -185,4 +185,4 @@ globalThis.$msg = $msg; globalThis.$pres = $pres; globalThis.Strophe = Strophe; -export { Builder, $build, $iq, $msg, $pres, Strophe, stx, toStanza }; +export { Builder, $build, $iq, $msg, $pres, Strophe, Stanza, stx, toStanza }; diff --git a/src/stanza.js b/src/stanza.js index 150fd847..4f4fecfb 100644 --- a/src/stanza.js +++ b/src/stanza.js @@ -36,7 +36,7 @@ export function toStanza(string, throwErrorIfInvalidNS) { * A Stanza represents a XML element used in XMPP (commonly referred to as * stanzas). */ -class Stanza { +export class Stanza { /** * @param { string[] } strings * @param { any[] } values diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 44f09fe3..b0610eb5 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -198,6 +198,7 @@ export const Strophe: { */ SECONDARY_TIMEOUT: number; }; +import { Stanza } from './stanza.js'; import { stx } from './stanza.js'; import { toStanza } from './stanza.js'; import * as shims from './shims.js'; @@ -220,5 +221,5 @@ import SASLMechanism from './sasl.js'; import { Status } from './constants.js'; import TimedHandler from './timed-handler.js'; import * as utils from './utils.js'; -export { Builder, $build, $iq, $msg, $pres, stx, toStanza }; +export { Builder, $build, $iq, $msg, $pres, Stanza, stx, toStanza }; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/src/types/stanza.d.ts b/src/types/stanza.d.ts index b3f5d198..5937470e 100644 --- a/src/types/stanza.d.ts +++ b/src/types/stanza.d.ts @@ -16,7 +16,7 @@ export function stx(strings: string[], ...values: any[]): Stanza; * A Stanza represents a XML element used in XMPP (commonly referred to as * stanzas). */ -declare class Stanza { +export class Stanza { /** * @param { string[] } strings * @param { any[] } values @@ -35,5 +35,4 @@ declare class Stanza { tree(): Element; node: any; } -export {}; //# sourceMappingURL=stanza.d.ts.map \ No newline at end of file