UNPKG

2 kBTypeScriptView Raw
1/**
2 * Create a function to test an API version to see if it is compatible with the provided ownVersion.
3 *
4 * The returned function has the following semantics:
5 * - Exact match is always compatible
6 * - Major versions must match exactly
7 * - 1.x package cannot use global 2.x package
8 * - 2.x package cannot use global 1.x package
9 * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
10 * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
11 * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
12 * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
13 * - Patch and build tag differences are not considered at this time
14 *
15 * @param ownVersion version which should be checked against
16 */
17export declare function _makeCompatibilityCheck(ownVersion: string): (globalVersion: string) => boolean;
18/**
19 * Test an API version to see if it is compatible with this API.
20 *
21 * - Exact match is always compatible
22 * - Major versions must match exactly
23 * - 1.x package cannot use global 2.x package
24 * - 2.x package cannot use global 1.x package
25 * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
26 * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
27 * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
28 * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
29 * - Patch and build tag differences are not considered at this time
30 *
31 * @param version version of the API requesting an instance of the global API
32 */
33export declare const isCompatible: (globalVersion: string) => boolean;
34//# sourceMappingURL=semver.d.ts.map
\No newline at end of file