mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
cordova-plugin-x-socialsharing: Provides its own types (#39635)
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
c7d0fd5b72
commit
97c196a894
@@ -660,6 +660,12 @@
|
||||
"sourceRepoURL": "https://github.com/apache/cordova-plugin-vibration",
|
||||
"asOfVersion": "2.1.4"
|
||||
},
|
||||
{
|
||||
"libraryName": "cordova-plugin-x-socialsharing",
|
||||
"typingsPackageName": "cordova-plugin-x-socialsharing",
|
||||
"sourceRepoURL": "https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin",
|
||||
"asOfVersion": "5.4.5"
|
||||
},
|
||||
{
|
||||
"libraryName": "cordova.plugins.diagnostic",
|
||||
"typingsPackageName": "cordova.plugins.diagnostic",
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/// <reference types="cordova" />
|
||||
|
||||
window.plugins.socialsharing.iPadPopupCoordinates = function () {
|
||||
return "100,100,200,300";
|
||||
};
|
||||
|
||||
window.plugins.socialsharing.setIPadPopupCoordinates("100,100,200,300");
|
||||
|
||||
window.plugins.socialsharing.available(function (isAvailable) {
|
||||
if (isAvailable) {
|
||||
// now use any of the share() functions
|
||||
}
|
||||
});
|
||||
|
||||
window.plugins.socialsharing.share("Message only");
|
||||
window.plugins.socialsharing.share("Message and subject", "The subject");
|
||||
window.plugins.socialsharing.share(null, null, null, "http://www.x-services.nl");
|
||||
window.plugins.socialsharing.share("Message and link", null, null, "http://www.x-services.nl");
|
||||
window.plugins.socialsharing.share(null, null, "https://www.google.nl/images/srpr/logo4w.png", null);
|
||||
window.plugins.socialsharing.share(null, "Android filename", "data:image/png;base64,R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmNlnibXdVqolmhcRQA7", null);
|
||||
window.plugins.socialsharing.share("Message and image", null, "https://www.google.nl/images/srpr/logo4w.png", null);
|
||||
window.plugins.socialsharing.share("Message, image and link", null, "https://www.google.nl/images/srpr/logo4w.png", "http://www.x-services.nl");
|
||||
window.plugins.socialsharing.share("Message, subject, image and link", "The subject", "https://www.google.nl/images/srpr/logo4w.png", "http://www.x-services.nl");
|
||||
|
||||
window.plugins.socialsharing.shareViaTwitter("Message via Twitter");
|
||||
window.plugins.socialsharing.shareViaTwitter("Message and link via Twitter", null, "http://www.x-services.nl");
|
||||
|
||||
window.plugins.socialsharing.shareViaFacebook("Message via Facebook", null, null, function () { console.log("share ok") }, function (errormsg) { alert(errormsg) });
|
||||
window.plugins.socialsharing.shareViaFacebookWithPasteMessageHint("Message via Facebook", null, null, "Paste it dude!", function () { console.log("share ok") }, function (errormsg) { alert(errormsg) });
|
||||
|
||||
window.plugins.socialsharing.shareViaInstagram("Message via Instagram", "https://www.google.nl/images/srpr/logo4w.png", function () { console.log("share ok") }, function (errormsg) { alert(errormsg) });
|
||||
|
||||
window.plugins.socialsharing.shareViaWhatsApp("Message via WhatsApp", null, null, function () { console.log("share ok") }, function (errormsg) { alert(errormsg) });
|
||||
|
||||
window.plugins.socialsharing.shareViaSMS("My cool message", null, function (msg) { console.log("ok: " + msg) }, function (msg) { alert("error: " + msg) });
|
||||
window.plugins.socialsharing.shareViaSMS("My cool message", "0612345678,0687654321", function (msg) { console.log("ok: " + msg) }, function (msg) { alert("error: " + msg) });
|
||||
window.plugins.socialsharing.shareViaSMS({ "message": "My cool message", "subject": "The subject", "image": "https://www.google.nl/images/srpr/logo4w.png" }, "0612345678,0687654321", function (msg) { console.log("ok: " + msg) }, function (msg) { alert("error: " + msg) });
|
||||
|
||||
window.plugins.socialsharing.shareViaEmail("Message", "Subject", ["to@person1.com", "to@person2.com"], ["cc@person1.com"], null, ["https://www.google.nl/images/srpr/logo4w.png", "www/localimage.png"], function () { console.log("share ok") }, function (errormsg) { alert(errormsg) });
|
||||
|
||||
window.plugins.socialsharing.shareVia("com.apple.social.facebook", "Message via FB", null, null, null, function () { console.log("share ok") }, function (msg) { alert("error: " + msg) });
|
||||
window.plugins.socialsharing.shareVia("facebook", "Message via FB", null, null, null, function () { console.log("share ok") }, function (msg) { alert("error: " + msg) });
|
||||
window.plugins.socialsharing.shareVia("com.apple.social.twitter", "Message via Twitter", null, null, "http://www.x-services.nl", function () { console.log("share ok") }, function (msg) { alert("error: " + msg) });
|
||||
window.plugins.socialsharing.shareVia("bogus_app", "Message via Bogus App", null, null, null, function () { console.log("share ok") }, function (msg) { alert("error: " + msg) });
|
||||
|
||||
window.plugins.socialsharing.canShareVia("com.tencent.mm/com.tencent.mm.ui.tools.ShareToTimeLineUI", "msg", null, "img", null, function (e) { alert(e) }, function (e) { alert(e) });
|
||||
window.plugins.socialsharing.canShareVia("com.apple.social.facebook", "msg", null, null, null, function (e) { alert(e) }, function (e) { alert(e) });
|
||||
window.plugins.socialsharing.canShareVia("whatsapp", "msg", null, null, null, function (e) { alert(e) }, function (e) { alert(e) });
|
||||
window.plugins.socialsharing.canShareVia("sms", "msg", null, null, null, function (e) { alert(e) }, function (e) { alert(e) });
|
||||
window.plugins.socialsharing.canShareVia("instagram", "msg", null, null, null, function (e) { alert(e) }, function (e) { alert(e) });
|
||||
window.plugins.socialsharing.canShareViaEmail(function (e) { alert(e) }, function (e) { alert(e) });
|
||||
|
||||
window.plugins.socialsharing.share(null, null, "www/image.gif", null);
|
||||
window.plugins.socialsharing.share(null, null, "/Users/username/Library/Application Support/iPhone/6.1/Applications/25A1E7CF-079F-438D-823B-55C6F8CD2DC0/Documents/.nl.x-services.appname/pics/img.jpg");
|
||||
window.plugins.socialsharing.share(null, null, "file:///Users/username/Library/Application Support/iPhone/6.1/Applications/25A1E7CF-079F-438D-823B-55C6F8CD2DC0/Documents/.nl.x-services.appname/pics/img.jpg");
|
||||
window.plugins.socialsharing.share(null, null, "file:///storage/emulated/0/nl.xservices.testapp/5359/Photos/16832/Thumb.jpg");
|
||||
window.plugins.socialsharing.share(null, null, "http://domain.com/image.jpg");
|
||||
|
||||
window.plugins.socialsharing.shareViaFacebook("Optional message, may be ignored by Facebook app", ["https://www.google.nl/images/srpr/logo4w.png", "www/image.gif"], null);
|
||||
window.plugins.socialsharing.share("Optional message", "Optional title", ["www/manual.pdf", "https://www.google.nl/images/srpr/logo4w.png"], "http://www.myurl.com");
|
||||
|
||||
window.plugins.socialsharing.saveToPhotoAlbum(["https://www.google.nl/images/srpr/logo4w.png", "www/image.gif"], function () { console.log("share ok") }, function (msg) { alert("error: " + msg) });
|
||||
window.plugins.socialsharing.shareWithOptions({"message":"sharethis","subject":"thesubject","files":["",""],"url":"https: //www.website.com/foo/#bar?a=b","chooserTitle":"Pickanapp"}, function () { console.log("share ok") }, function (msg) { alert("error: " + msg) });
|
||||
-69
@@ -1,69 +0,0 @@
|
||||
// Type definitions for SocialSharing-PhoneGap-Plugin v5.1.9
|
||||
// Project: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin
|
||||
// Definitions by: Markus Wagner <https://github.com/Ritzlgrmft>, Larry Bahr <https://github.com/larrybahr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Window {
|
||||
plugins: CordovaPlugins;
|
||||
}
|
||||
|
||||
interface CordovaPlugins {
|
||||
socialsharing: SocialSharingPlugin.SocialSharing;
|
||||
}
|
||||
|
||||
declare module SocialSharingPlugin {
|
||||
|
||||
interface ShareOptions {
|
||||
message: string;
|
||||
subject?: string;
|
||||
files?: string | string[];
|
||||
url?: string;
|
||||
chooserTitle?: string;
|
||||
}
|
||||
|
||||
interface ShareResult {
|
||||
completed: boolean;
|
||||
app: any;
|
||||
}
|
||||
|
||||
export interface SocialSharing {
|
||||
|
||||
/**
|
||||
* Override this method (after deviceready) to set the location where you want the iPad popup arrow to appear.
|
||||
* If not overridden with different values, the popup is not used.
|
||||
*/
|
||||
iPadPopupCoordinates: () => string;
|
||||
|
||||
setIPadPopupCoordinates(coords: string): void;
|
||||
|
||||
available(callback: (isAvailable: boolean) => void): void;
|
||||
|
||||
share(message: string, subject?: string, fileOrFileArray?: string | string[], url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
shareWithOptions(options: ShareOptions, successCallback?: (result: ShareResult) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
shareViaTwitter(message: string, file?: string, url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
shareViaFacebook(message: string, fileOrFileArray?: string | string[], url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
shareViaFacebookWithPasteMessageHint(message: string, fileOrFileArray: string | string[], url: string, pasteMessageHint: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
shareViaWhatsApp(message: string, fileOrFileArray?: string | string[], url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
shareViaWhatsAppToReceiver(receiver: string, message: string, fileOrFileArray?: string | string[], url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
shareViaSMS(options: string | { message: string; subject: string; image: string; }, phonenumbers: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
shareViaEmail(message: string, subject: string, toArray?: string[], ccArray?: string[], bccArray?: string[], fileOrFileArray?: string | string[], successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
canShareVia(via: string, message: string, subject?: string, fileOrFileArray?: string | string[], url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
canShareViaEmail(successCallback: (succeeded: boolean) => void, errorCallback: (errormsd: string) => void): void;
|
||||
|
||||
shareViaInstagram(message: string, fileOrFileArray: string | string[], successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
shareVia(via: string, message: string, subject: string, fileOrFileArray: string | string[], url: string, successCallback: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
|
||||
saveToPhotoAlbum(fileOrFileArray: string | string[], successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cordova-plugin-x-socialsharing-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"npm-naming": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user