mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
/// <reference path="persona.d.ts" />
|
|
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/API/navigator.id.watch
|
|
navigator.id.watch({
|
|
loggedInUser: 'bob@example.org',
|
|
onlogin: function(assertion: String) {},
|
|
onlogout: function() {}
|
|
});
|
|
navigator.id.watch({
|
|
loggedInUser: 'bob@example.org',
|
|
onlogin: function(assertion: String) {},
|
|
onlogout: function() {},
|
|
onready: function() {}
|
|
});
|
|
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/API/navigator.id.request
|
|
navigator.id.request();
|
|
navigator.id.request({siteName: 'Example Site', siteLogo: '/logo.png'});
|
|
navigator.id.request({termsOfService: '/tos.html', privacyPolicy: '/privacy.html'});
|
|
navigator.id.request({
|
|
backgroundColor: '#rrggbb',
|
|
siteName: 'My Example Site',
|
|
siteLogo: '/logo.png',
|
|
termsOfService: '/tos.html',
|
|
privacyPolicy: '/privacy.html',
|
|
returnTo: '/welcome.html',
|
|
oncancel: function() {}
|
|
});
|
|
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/API/navigator.id.logout
|
|
navigator.id.logout();
|
|
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/API/navigator.id.get
|
|
var gotAssertion = function ( assertion: String ) {}
|
|
navigator.id.get(gotAssertion);
|
|
navigator.id.get(gotAssertion, {privacyPolicy: "/privacy.html", termsOfService: "/tos.html"});
|
|
navigator.id.get(gotAssertion, {
|
|
backgroundColor: '#rrggbb',
|
|
siteName: 'My Example Site',
|
|
siteLogo: '/logo.png',
|
|
termsOfService: '/tos.html',
|
|
privacyPolicy: '/privacy.html'
|
|
});
|
|
|