@imagekit/javascript 5.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/dist/constants/errorMessages.d.ts +63 -0
- package/dist/constants/supportedTransforms.d.ts +7 -0
- package/dist/imagekit.cjs.js +619 -0
- package/dist/imagekit.esm.js +609 -0
- package/dist/imagekit.min.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/interfaces/SrcOptions.d.ts +32 -0
- package/dist/interfaces/Transformation.d.ts +624 -0
- package/dist/interfaces/UploadOptions.d.ts +164 -0
- package/dist/interfaces/UploadResponse.d.ts +175 -0
- package/dist/interfaces/index.d.ts +4 -0
- package/dist/upload.d.ts +49 -0
- package/dist/url.d.ts +16 -0
- package/dist/utils/transformation.d.ts +10 -0
- package/package.json +76 -0
- package/src/constants/errorMessages.ts +24 -0
- package/src/constants/supportedTransforms.ts +80 -0
- package/src/index.ts +13 -0
- package/src/interfaces/SrcOptions.ts +35 -0
- package/src/interfaces/Transformation.ts +723 -0
- package/src/interfaces/UploadOptions.ts +192 -0
- package/src/interfaces/UploadResponse.ts +182 -0
- package/src/interfaces/index.ts +7 -0
- package/src/upload.ts +274 -0
- package/src/url.ts +301 -0
- package/src/utils/transformation.ts +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[<img width="250" alt="ImageKit.io" src="https://raw.githubusercontent.com/imagekit-developer/imagekit-javascript/master/assets/imagekit-light-logo.svg"/>](https://imagekit.io)
|
|
2
|
+
|
|
3
|
+
# ImageKit.io JavaScript SDK
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
[](https://www.npmjs.com/package/@imagekit/javascript)
|
|
9
|
+
[](https://codecov.io/gh/imagekit-developer/imagekit-javascript)
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
[](https://twitter.com/ImagekitIo)
|
|
12
|
+
|
|
13
|
+
This lightweight, dependency-free JavaScript SDK is designed specifically for browser use. It provides utility functions to generate image and video `src` URLs using [ImageKit transformations](https://imagekit.io/docs/transformations) and to upload files to the ImageKit media library.
|
|
14
|
+
|
|
15
|
+
For server-side applications with Node.js, please refer to our official [Node.js SDK](https://github.com/imagekit-developer/imagekit-nodejs).
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
You can install the SDK in your project using npm or yarn.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @imagekit/javascript
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## TypeScript support
|
|
26
|
+
|
|
27
|
+
The SDK is written in TypeScript, offering first-class TypeScript support. Enjoy excellent type safety and IntelliSense in your IDE. You can use it in your TypeScript projects without any additional configuration.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
To enable type checking in JavaScript projects, add `//@ts-check` at the top of your JavaScript files. This will activate type checking in your IDE.
|
|
31
|
+
|
|
32
|
+
## Documentation
|
|
33
|
+
|
|
34
|
+
Refer to the ImageKit [official documentation](https://imagekit.io/docs/integration/javascript) for more details on how to use the SDK.
|
|
35
|
+
|
|
36
|
+
## Changelog
|
|
37
|
+
|
|
38
|
+
For a detailed history of changes, refer to [CHANGELOG.md](CHANGELOG.md).
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
MANDATORY_INITIALIZATION_MISSING: {
|
|
3
|
+
message: string;
|
|
4
|
+
};
|
|
5
|
+
INVALID_TRANSFORMATION_POSITION: {
|
|
6
|
+
message: string;
|
|
7
|
+
};
|
|
8
|
+
PRIVATE_KEY_CLIENT_SIDE: {
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
MISSING_UPLOAD_DATA: {
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
MISSING_UPLOAD_FILE_PARAMETER: {
|
|
15
|
+
message: string;
|
|
16
|
+
};
|
|
17
|
+
MISSING_UPLOAD_FILENAME_PARAMETER: {
|
|
18
|
+
message: string;
|
|
19
|
+
};
|
|
20
|
+
MISSING_AUTHENTICATION_ENDPOINT: {
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
MISSING_PUBLIC_KEY: {
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
AUTH_ENDPOINT_TIMEOUT: {
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
29
|
+
AUTH_ENDPOINT_NETWORK_ERROR: {
|
|
30
|
+
message: string;
|
|
31
|
+
};
|
|
32
|
+
AUTH_INVALID_RESPONSE: {
|
|
33
|
+
message: string;
|
|
34
|
+
};
|
|
35
|
+
UPLOAD_ENDPOINT_NETWORK_ERROR: {
|
|
36
|
+
message: string;
|
|
37
|
+
};
|
|
38
|
+
INVALID_UPLOAD_OPTIONS: {
|
|
39
|
+
message: string;
|
|
40
|
+
};
|
|
41
|
+
MISSING_SIGNATURE: {
|
|
42
|
+
message: string;
|
|
43
|
+
};
|
|
44
|
+
MISSING_TOKEN: {
|
|
45
|
+
message: string;
|
|
46
|
+
};
|
|
47
|
+
MISSING_EXPIRE: {
|
|
48
|
+
message: string;
|
|
49
|
+
};
|
|
50
|
+
INVALID_TRANSFORMATION: {
|
|
51
|
+
message: string;
|
|
52
|
+
};
|
|
53
|
+
INVALID_PRE_TRANSFORMATION: {
|
|
54
|
+
message: string;
|
|
55
|
+
};
|
|
56
|
+
INVALID_POST_TRANSFORMATION: {
|
|
57
|
+
message: string;
|
|
58
|
+
};
|
|
59
|
+
UPLOAD_ABORTED: {
|
|
60
|
+
message: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export default _default;
|