1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Version | ruffle-core</title><meta name="description" content="Documentation for ruffle-core"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">ruffle-core</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">ruffle-core</a></li><li><a href="Version.html">Version</a></li></ul><h1>Class Version</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>A representation of a semver 2 compliant version string</p>
- </div><div class="tsd-comment tsd-typography"></div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ruffle-rs/ruffle/blob/78e9426ba92b069f817c2fc3031f0273b90efe41/web/packages/core/src/version.ts#L4">packages/core/src/version.ts:4</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="Version.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
- </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="Version.html#fromSemver" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>from<wbr/>Semver</span></a>
- <a href="Version.html#isCompatibleWith" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Compatible<wbr/>With</span></a>
- <a href="Version.html#hasPrecedenceOver" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>has<wbr/>Precedence<wbr/>Over</span></a>
- <a href="Version.html#isEqual" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Equal</span></a>
- <a href="Version.html#isStableOrCompatiblePrerelease" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Stable<wbr/>Or<wbr/>Compatible<wbr/>Prerelease</span></a>
- </div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_Version" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Version</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">major</span>, <span class="tsd-kind-parameter">minor</span>, <span class="tsd-kind-parameter">patch</span>, <span class="tsd-kind-parameter">prIdent</span>, <span class="tsd-kind-parameter">buildIdent</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Version.html" class="tsd-signature-type tsd-kind-class">Version</a><a href="#constructor.new_Version" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Construct a Version from specific components.</p>
- <p>If you wish to parse a string into a Version then please use [[fromSemver]].</p>
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">major</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The major version component.</p>
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">minor</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The minor version component.</p>
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">patch</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The patch version component.</p>
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">prIdent</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>A list of pre-release identifiers, if any</p>
- </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">buildIdent</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>A list of build identifiers, if any</p>
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="Version.html" class="tsd-signature-type tsd-kind-class">Version</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ruffle-rs/ruffle/blob/78e9426ba92b069f817c2fc3031f0273b90efe41/web/packages/core/src/version.ts#L16">packages/core/src/version.ts:16</a></li></ul></aside></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Methods</h2><section class="tsd-panel tsd-member"><a id="fromSemver" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>from<wbr/>Semver</span><a href="#fromSemver" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="fromSemver.fromSemver-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">from<wbr/>Semver</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">versionString</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Version.html" class="tsd-signature-type tsd-kind-class">Version</a><a href="#fromSemver.fromSemver-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Construct a version from a semver 2 compliant string.</p>
- <p>This function is intended for use with semver 2 compliant strings.
- Malformed strings may still parse correctly, but this result is not
- guaranteed.</p>
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">versionString</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>A semver 2.0.0 compliant version string</p>
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="Version.html" class="tsd-signature-type tsd-kind-class">Version</a></h4><p>A version object</p>
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ruffle-rs/ruffle/blob/78e9426ba92b069f817c2fc3031f0273b90efe41/web/packages/core/src/version.ts#L34">packages/core/src/version.ts:34</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="isCompatibleWith" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>is<wbr/>Compatible<wbr/>With</span><a href="#isCompatibleWith" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="isCompatibleWith.isCompatibleWith-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">is<wbr/>Compatible<wbr/>With</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">other</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#isCompatibleWith.isCompatibleWith-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns true if a given version is compatible with this one.</p>
- <p>Compatibility is defined as having the same nonzero major version
- number, or if both major versions are zero, the same nonzero minor
- version number, or if both minor versions are zero, the same nonzero
- patch version number.</p>
- <p>This implements the ^ operator in npm's semver package, with the
- exception of the prerelease exclusion rule.</p>
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">other</span>: <a href="Version.html" class="tsd-signature-type tsd-kind-class">Version</a></span><div class="tsd-comment tsd-typography"><p>The other version to test against</p>
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p>True if compatible</p>
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ruffle-rs/ruffle/blob/78e9426ba92b069f817c2fc3031f0273b90efe41/web/packages/core/src/version.ts#L78">packages/core/src/version.ts:78</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="hasPrecedenceOver" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>has<wbr/>Precedence<wbr/>Over</span><a href="#hasPrecedenceOver" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="hasPrecedenceOver.hasPrecedenceOver-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">has<wbr/>Precedence<wbr/>Over</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">other</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#hasPrecedenceOver.hasPrecedenceOver-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns true if this version has precedence over (is newer than) another
- version.</p>
- <p>Precedence is defined as in the Semver 2 spec. This implements the >
- operator in npm's semver package, with the exception of the prerelease
- exclusion rule.</p>
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">other</span>: <a href="Version.html" class="tsd-signature-type tsd-kind-class">Version</a></span><div class="tsd-comment tsd-typography"><p>The other version to test against</p>
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p>True if this version has precedence over the other one</p>
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ruffle-rs/ruffle/blob/78e9426ba92b069f817c2fc3031f0273b90efe41/web/packages/core/src/version.ts#L105">packages/core/src/version.ts:105</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="isEqual" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>is<wbr/>Equal</span><a href="#isEqual" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="isEqual.isEqual-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">is<wbr/>Equal</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">other</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#isEqual.isEqual-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Tests if a given version is equivalent to this one.</p>
- <p>Build and prerelease tags are ignored.</p>
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">other</span>: <a href="Version.html" class="tsd-signature-type tsd-kind-class">Version</a></span><div class="tsd-comment tsd-typography"><p>The other version to test against</p>
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p>True if the given version is equivalent</p>
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ruffle-rs/ruffle/blob/78e9426ba92b069f817c2fc3031f0273b90efe41/web/packages/core/src/version.ts#L214">packages/core/src/version.ts:214</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="isStableOrCompatiblePrerelease" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>is<wbr/>Stable<wbr/>Or<wbr/>Compatible<wbr/>Prerelease</span><a href="#isStableOrCompatiblePrerelease" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="isStableOrCompatiblePrerelease.isStableOrCompatiblePrerelease-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">is<wbr/>Stable<wbr/>Or<wbr/>Compatible<wbr/>Prerelease</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">other</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#isStableOrCompatiblePrerelease.isStableOrCompatiblePrerelease-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Tests if a given version is stable or a compatible prerelease for this
- version.</p>
- <p>This implements the prerelease exclusion rule of NPM semver: a
- prerelease version can only pass this check if the major/minor/patch
- components of both versions are the same. Otherwise, the prerelease
- version always fails.</p>
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">other</span>: <a href="Version.html" class="tsd-signature-type tsd-kind-class">Version</a></span><div class="tsd-comment tsd-typography"><p>The other version to test against</p>
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p>True if the given version is either stable, or a
- prerelease in the same series as this one.</p>
- <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ruffle-rs/ruffle/blob/78e9426ba92b069f817c2fc3031f0273b90efe41/web/packages/core/src/version.ts#L235">packages/core/src/version.ts:235</a></li></ul></aside></li></ul></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a><a href="#fromSemver" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>from<wbr/>Semver</span></a><a href="#isCompatibleWith" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Compatible<wbr/>With</span></a><a href="#hasPrecedenceOver" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>has<wbr/>Precedence<wbr/>Over</span></a><a href="#isEqual" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Equal</span></a><a href="#isStableOrCompatiblePrerelease" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Stable<wbr/>Or<wbr/>Compatible<wbr/>Prerelease</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>ruffle-core</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|