本文整理匯總了TypeScript中@phosphor/coreutils.UUID.uuid4方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript UUID.uuid4方法的具體用法?TypeScript UUID.uuid4怎麽用?TypeScript UUID.uuid4使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@phosphor/coreutils.UUID
的用法示例。
在下文中一共展示了UUID.uuid4方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: createDomID
export function createDomID(): string {
return `id-${UUID.uuid4()}`;
}
示例2: it
it('should fail if the session is disposed', async () => {
const session = Session.connectTo(defaultSession.model);
session.dispose();
let promise = session.setPath(UUID.uuid4());
await expectFailure(promise, null, 'Session is disposed');
});
示例3: it
it('should start a session', async () => {
const session = await manager.startNew({ path: UUID.uuid4() });
await session.kernel.ready;
expect(session.id).to.be.ok;
return session.shutdown();
});
示例4: startNew
/**
* Start a new session with a unique name.
*/
function startNew(): Promise<Session.ISession> {
return Session.startNew({ path: UUID.uuid4() });
}
示例5: it
it('should fail for improper model', async () => {
handleRequest(defaultSession, 200, {});
await expectFailure(defaultSession.setName(UUID.uuid4()));
});
示例6: it
it('should accept ajax options', async () => {
const serverSettings = makeSettings();
const options: Session.IOptions = { path: UUID.uuid4(), serverSettings };
session = await Session.startNew(options);
expect(session.id).to.be.ok;
});