diff options
Diffstat (limited to 'services/fxaccounts/rust-bridge/mozIFirefoxAccountsBridge.idl')
-rw-r--r-- | services/fxaccounts/rust-bridge/mozIFirefoxAccountsBridge.idl | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/services/fxaccounts/rust-bridge/mozIFirefoxAccountsBridge.idl b/services/fxaccounts/rust-bridge/mozIFirefoxAccountsBridge.idl new file mode 100644 index 0000000000..f896242448 --- /dev/null +++ b/services/fxaccounts/rust-bridge/mozIFirefoxAccountsBridge.idl @@ -0,0 +1,58 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIPropertyBag; +interface nsIVariant; + +// A generic callback called with a result. Variants are automatically unboxed +// in JavaScript: for example, a `UTF8String` will be passed as a string +// argument; an `Int32` or `Int64` as a number. Methods that don't return a +// value will pass a `null` variant to `handleSuccess`. +// For all callback types in this file, either `handleSuccess` +// or `handleError` is guaranteed to be called once. +[uuid(341b13a2-d121-4799-9870-9900861d98a0), scriptable] +interface mozIFirefoxAccountsBridgeCallback : nsISupports { + void handleSuccess(in nsIVariant result); + void handleError(in nsresult code, in AUTF8String message); +}; + +[uuid(f33d083c-7443-11ea-bc8c-a517fc2ca371), scriptable] +interface mozIFirefoxAccountsBridge : nsISupports { + void init(in nsIPropertyBag options); + void initFromJSON(in AUTF8String json); + void stateJSON(in mozIFirefoxAccountsBridgeCallback callback); + + void beginOAuthFlow(in Array<AUTF8String> scopes, in AUTF8String entryPoint, in mozIFirefoxAccountsBridgeCallback callback); + void completeOAuthFlow(in AUTF8String code, in AUTF8String state, in mozIFirefoxAccountsBridgeCallback callback); + void disconnect(in mozIFirefoxAccountsBridgeCallback callback); + + void getAccessToken(in AUTF8String scope, in unsigned long long ttl, in mozIFirefoxAccountsBridgeCallback callback); + void getSessionToken(in mozIFirefoxAccountsBridgeCallback callback); + void getAttachedClients(in mozIFirefoxAccountsBridgeCallback callback); + void checkAuthorizationStatus(in mozIFirefoxAccountsBridgeCallback callback); + void clearAccessTokenCache(in mozIFirefoxAccountsBridgeCallback callback); + void handleSessionTokenChange(in AUTF8String sessionToken, in mozIFirefoxAccountsBridgeCallback callback); + + void migrateFromSessionToken(in AUTF8String sessionToken, in AUTF8String kSync, in AUTF8String kXCS, in boolean copySessionToken, in mozIFirefoxAccountsBridgeCallback callback); + void retryMigrateFromSessionToken(in mozIFirefoxAccountsBridgeCallback callback); + void isInMigrationState(in mozIFirefoxAccountsBridgeCallback callback); + + void getProfile(in boolean ignoreCache, in mozIFirefoxAccountsBridgeCallback callback); + + void getTokenServerEndpointURL(in mozIFirefoxAccountsBridgeCallback callback); + void getConnectionSuccessURL(in mozIFirefoxAccountsBridgeCallback callback); + void getManageAccountURL(in AUTF8String entrypoint, in mozIFirefoxAccountsBridgeCallback callback); + void getManageDevicesURL(in AUTF8String entrypoint, in mozIFirefoxAccountsBridgeCallback callback); + + void fetchDevices(in boolean ignoreCache, in mozIFirefoxAccountsBridgeCallback callback); + void setDeviceDisplayName(in AUTF8String name, in mozIFirefoxAccountsBridgeCallback callback); + void handlePushMessage(in AUTF8String payload, in mozIFirefoxAccountsBridgeCallback callback); + void pollDeviceCommands(in mozIFirefoxAccountsBridgeCallback callback); + void sendSingleTab(in AUTF8String targetId, in AUTF8String title, in AUTF8String url, in mozIFirefoxAccountsBridgeCallback callback); + void setDevicePushSubscription(in AUTF8String endpoint, in AUTF8String publicKey, in AUTF8String authKey, in mozIFirefoxAccountsBridgeCallback callback); + void initializeDevice(in AUTF8String name, in AUTF8String deviceType, in Array<AUTF8String> supportedCapabilities, in mozIFirefoxAccountsBridgeCallback callback); + void ensureCapabilities(in Array<AUTF8String> supportedCapabilities, in mozIFirefoxAccountsBridgeCallback callback); +}; |