Parcourir la source

Add missing files required for typescript tests.

Renée Kooi il y a 6 ans
Parent
commit
3a29b86ef9
2 fichiers modifiés avec 60 ajouts et 0 suppressions
  1. 27 0
      packages/uppy/types/tsconfig.json
  2. 33 0
      packages/uppy/types/uppy-tests.ts

+ 27 - 0
packages/uppy/types/tsconfig.json

@@ -0,0 +1,27 @@
+{
+  "compilerOptions": {
+    "target": "esnext",
+    "module": "commonjs",
+    "lib": [
+      "dom",
+      "esnext"
+    ],
+    "noImplicitAny": true,
+    "noImplicitThis": true,
+    "strictNullChecks": true,
+    "baseUrl": "../",
+    "typeRoots": [
+      "../"
+    ],
+    "types": [],
+    "noEmit": true,
+    "esModuleInterop": true,
+    "allowSyntheticDefaultImports": true,
+    "strictFunctionTypes": true,
+    "forceConsistentCasingInFileNames": true
+  },
+  "files": [
+    "index.d.ts",
+    "uppy-tests.ts"
+  ]
+}

+ 33 - 0
packages/uppy/types/uppy-tests.ts

@@ -0,0 +1,33 @@
+import Uppy = require('uppy');
+
+(() => {
+  const uppy = Uppy.Core({ autoProceed: false });
+  uppy.use(Uppy.Dashboard, { trigger: '#up_load_file_01' });
+  uppy.use(Uppy.DragDrop, { target: '#ttt' });
+  uppy.use(Uppy.XHRUpload, {
+    bundle: true,
+    endpoint: 'xxx',
+    fieldName: 'up_load_file'
+  });
+  uppy.on('upload-success', (fileCount, body, uploadurl) => {
+    console.log(fileCount, body, uploadurl, ` files uploaded`);
+  });
+})();
+
+(() => {
+  const uppy = Uppy.Core({ autoProceed: false })
+    .use(Uppy.Dashboard, { trigger: '#select-files' })
+    .use(Uppy.GoogleDrive, { target: Uppy.Dashboard, serverUrl: 'https://server.uppy.io' })
+    .use(Uppy.Instagram, { target: Uppy.Dashboard, serverUrl: 'https://server.uppy.io' })
+    .use(Uppy.Webcam, { target: Uppy.Dashboard })
+    .use(Uppy.Tus, { endpoint: 'https://master.tus.io/files/' })
+    .on('complete', (result) => {
+      console.log('Upload result:', result);
+    });
+})();
+
+(() => {
+  const uppy = Uppy.Core();
+  uppy.use(Uppy.DragDrop, { target: '.UppyDragDrop' });
+  uppy.use(Uppy.Tus, { endpoint: '//master.tus.io/files/' });
+})();