type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration |
getCurrentRenderTarget(variable: Variable): RenderTarget; | DefinitelyMaybe/threejs_4_deno | examples/jsm/misc/GPUComputationRenderer.d.ts | TypeScript |
MethodDeclaration |
getAlternateRenderTarget(variable: Variable): RenderTarget; | DefinitelyMaybe/threejs_4_deno | examples/jsm/misc/GPUComputationRenderer.d.ts | TypeScript |
MethodDeclaration |
addResolutionDefine(materialShader: ShaderMaterial): void; | DefinitelyMaybe/threejs_4_deno | examples/jsm/misc/GPUComputationRenderer.d.ts | TypeScript |
MethodDeclaration |
createRenderTarget(
sizeXTexture: number,
sizeYTexture: number,
wrapS: Wrapping,
wrapT: number,
minFilter: TextureFilter,
magFilter: TextureFilter,
): RenderTarget; | DefinitelyMaybe/threejs_4_deno | examples/jsm/misc/GPUComputationRenderer.d.ts | TypeScript |
MethodDeclaration |
createTexture(): DataTexture; | DefinitelyMaybe/threejs_4_deno | examples/jsm/misc/GPUComputationRenderer.d.ts | TypeScript |
MethodDeclaration |
renderTexture(input: Texture, output: Texture): void; | DefinitelyMaybe/threejs_4_deno | examples/jsm/misc/GPUComputationRenderer.d.ts | TypeScript |
MethodDeclaration |
doRenderTarget(material: Material, output: RenderTarget): void; | DefinitelyMaybe/threejs_4_deno | examples/jsm/misc/GPUComputationRenderer.d.ts | TypeScript |
ArrowFunction |
data => {
let section = data.section as Section;
this.sectionName = section.name;
this.sectionId = section.id;
this.pinnedThreads = section.topics.filter(x => x.isPinned);
this.unpinnedThreads = section.topics.filter(x => !x.isPinned);
if(section.topics?.length == 0) this.isE... | HokaHelal/Madrasa | angular/src/app/forum/section-page/section-page.component.ts | TypeScript |
ArrowFunction |
x => x.isPinned | HokaHelal/Madrasa | angular/src/app/forum/section-page/section-page.component.ts | TypeScript |
ArrowFunction |
x => !x.isPinned | HokaHelal/Madrasa | angular/src/app/forum/section-page/section-page.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-section-page',
templateUrl: './section-page.component.html',
styleUrls: ['./section-page.component.scss']
})
export class SectionPageComponent implements OnInit {
pinnedThreads: TopicMain[];
unpinnedThreads: TopicMain[];
sectionName: string;
sectionId: number;
isEmpty = fal... | HokaHelal/Madrasa | angular/src/app/forum/section-page/section-page.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.route.data.subscribe(data => {
let section = data.section as Section;
this.sectionName = section.name;
this.sectionId = section.id;
this.pinnedThreads = section.topics.filter(x => x.isPinned);
this.unpinnedThreads = section.topics.filter(x => !x.isPinned);
... | HokaHelal/Madrasa | angular/src/app/forum/section-page/section-page.component.ts | TypeScript |
MethodDeclaration |
openNewThreadModal() {
const config = {
class: 'modal-dialog-centered modal-lg',
initialState: {
selectedSection: this.sectionId
}
};
this.bsModalRef = this.modalService.show(AddTopicModalComponent, config);
} | HokaHelal/Madrasa | angular/src/app/forum/section-page/section-page.component.ts | TypeScript |
ArrowFunction |
type => UserStrength | soumyanildas/cv-base | src/user/entities/strength.entity.ts | TypeScript |
ArrowFunction |
userStrength => userStrength.strength | soumyanildas/cv-base | src/user/entities/strength.entity.ts | TypeScript |
ClassDeclaration |
@Entity('strengths')
export class Strength {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({
type: 'text',
nullable: true
})
strengthName: string;
@OneToMany(type => UserStrength, userStrength => userStrength.strength)
strengths: UserStrength[];
} | soumyanildas/cv-base | src/user/entities/strength.entity.ts | TypeScript |
FunctionDeclaration |
function handleSort(id: string) {
if (id === sortColumn) {
setSortAsc(asc => !asc);
} else {
setSortColumn(id);
setSortAsc(true);
}
} | yashatgit/baseweb | documentation-site/examples/table-semantic/sortable.tsx | TypeScript |
ArrowFunction |
() => {
const [sortColumn, setSortColumn] = useState('bar');
const [sortAsc, setSortAsc] = useState(true);
const [data] = useState([
{
foo: 10,
bar: 'banana',
url: 'https://example.com/b',
},
{
foo: 1,
bar: 'carrot',
url: 'https://example.com/c',
},
{
... | yashatgit/baseweb | documentation-site/examples/table-semantic/sortable.tsx | TypeScript |
ArrowFunction |
() => {
return data.slice().sort((a: any, b: any) => {
const left = sortAsc ? a : b;
const right = sortAsc ? b : a;
const leftValue = String(left[sortColumn]);
const rightValue = String(right[sortColumn]);
return leftValue.localeCompare(rightValue, 'en', {
numeric: true,
... | yashatgit/baseweb | documentation-site/examples/table-semantic/sortable.tsx | TypeScript |
ArrowFunction |
(a: any, b: any) => {
const left = sortAsc ? a : b;
const right = sortAsc ? b : a;
const leftValue = String(left[sortColumn]);
const rightValue = String(right[sortColumn]);
return leftValue.localeCompare(rightValue, 'en', {
numeric: true,
sensitivity: 'base',
});
... | yashatgit/baseweb | documentation-site/examples/table-semantic/sortable.tsx | TypeScript |
ArrowFunction |
asc => !asc | yashatgit/baseweb | documentation-site/examples/table-semantic/sortable.tsx | TypeScript |
ClassDeclaration |
export class DatabaseConfigInfo
{
/*Bindable*/ public connection:string = "";
/*Bindable*/ public schema:string = "weave";
/*Bindable*/ public idFields:string[] = null;
} | WeaveTeam/WeaveJS | WeaveTSJS/src/weavejs/net/beans/DatabaseConfigInfo.ts | TypeScript |
ClassDeclaration |
export class ImportApiCommand extends $Command<
ImportApiCommandInput,
ImportApiCommandOutput,
ApiGatewayV2ClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties
constructor(readonly input: ImportApiCommandInput) {
// Start section: command_constructor
sup... | garrettheel/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/ImportApiCommand.ts | TypeScript |
TypeAliasDeclaration |
export type ImportApiCommandInput = ImportApiRequest; | garrettheel/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/ImportApiCommand.ts | TypeScript |
TypeAliasDeclaration |
export type ImportApiCommandOutput = ImportApiResponse & __MetadataBearer; | garrettheel/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/ImportApiCommand.ts | TypeScript |
MethodDeclaration |
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: ApiGatewayV2ClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ImportApiCommandInput, ImportApiCommandOutput> {
this.middlewareStack.use(
getSerdePlugin(configuration, this.serial... | garrettheel/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/ImportApiCommand.ts | TypeScript |
MethodDeclaration |
private serialize(
input: ImportApiCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> {
return serializeAws_restJson1_1ImportApiCommand(input, context);
} | garrettheel/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/ImportApiCommand.ts | TypeScript |
MethodDeclaration |
private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<ImportApiCommandOutput> {
return deserializeAws_restJson1_1ImportApiCommand(output, context);
} | garrettheel/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/ImportApiCommand.ts | TypeScript |
ClassDeclaration |
export class Operacion implements Expresion {
linea: number;
columna: number;
op_izquierda: Expresion;
op_derecha: Expresion;
operador: Operador;
constructor(op_izquierda:Expresion, op_derecha:Expresion, operacion:Operador, linea:number, columna:number){
this.linea = linea;
thi... | 18SebastianVC/tytusx | 20211SVAC/G37/Codigo Fuente/CLASES/Operacion.ts | TypeScript |
EnumDeclaration |
export enum Operador {
ENTERO,
DECIMAL,
CADENA,
SUMA,
RESTA,
MULTIPLICACION,
DIVISION,
MODULO,
MENOS_UNARIO,
MAYOR_QUE,
MENOR_QUE,
IGUAL_IGUAL,
DIFERENTE_QUE,
OR,
AND,
NOT,
MAYOR_IGUA_QUE,
MENOR_IGUA_QUE,
DESCONOCIDO,
NODO,
AXE,
PO... | 18SebastianVC/tytusx | 20211SVAC/G37/Codigo Fuente/CLASES/Operacion.ts | TypeScript |
MethodDeclaration |
getTipo(ent: Ambito, arbol: AST): Tipo {
const valor = this.getValorImplicito(ent, arbol);
if (typeof(valor) === 'string'){
return Tipo.STRING;
}
else if (typeof(valor) === 'number'){
if(this.isInt(Number(valor))){
return Tipo.INT;
}
... | 18SebastianVC/tytusx | 20211SVAC/G37/Codigo Fuente/CLASES/Operacion.ts | TypeScript |
MethodDeclaration |
getValorImplicito(ent: Ambito, arbol: AST) {
if (this.operador !== Operador.MENOS_UNARIO && this.operador !== Operador.NOT && this.operador !== Operador.NODO){
let op1 = this.op_izquierda.getValorImplicito(ent, arbol);
let op2 = this.op_derecha.getValorImplicito(ent, arbol);
... | 18SebastianVC/tytusx | 20211SVAC/G37/Codigo Fuente/CLASES/Operacion.ts | TypeScript |
MethodDeclaration |
isInt(n:number){
return Number(n) === n && n % 1 === 0;
} | 18SebastianVC/tytusx | 20211SVAC/G37/Codigo Fuente/CLASES/Operacion.ts | TypeScript |
ArrowFunction |
() => {
this.setState({ itemCount: this.todoListService.getItemCount() });
} | harithay/preact-with-inversifyjs-as-di | webapp/src/components/app.tsx | TypeScript |
ArrowFunction |
() => {
this.setState({ listItems: this.todoListService.getListItems() });
} | harithay/preact-with-inversifyjs-as-di | webapp/src/components/app.tsx | TypeScript |
ArrowFunction |
($event) => this.addAndClearItem($event) | harithay/preact-with-inversifyjs-as-di | webapp/src/components/app.tsx | TypeScript |
ArrowFunction |
(item) => {
return <div>{item}</div>
} | harithay/preact-with-inversifyjs-as-di | webapp/src/components/app.tsx | TypeScript |
ClassDeclaration |
export default class App extends Component<any, AppState> {
@lazyInject('TODOListService') todoListService: TODOListService;
// Creates a reference to our html input element so that we can get its value
inputElement = createRef<HTMLInputElement>();
constructor() {
super();
this.state ... | harithay/preact-with-inversifyjs-as-di | webapp/src/components/app.tsx | TypeScript |
InterfaceDeclaration |
interface AppState {
itemCount: number;
listItems: string[];
} | harithay/preact-with-inversifyjs-as-di | webapp/src/components/app.tsx | TypeScript |
MethodDeclaration |
addAndClearItem($event) {
const item = this.inputElement.current.value;
if (item && item.length > 0) {
this.todoListService.addListItem(item);
}
this.inputElement.current.value = "";
} | harithay/preact-with-inversifyjs-as-di | webapp/src/components/app.tsx | TypeScript |
MethodDeclaration |
render() {
return (
<div id="app">
<div class="list-item-count">
You have {this.state.itemCount} items todo.
</div>
<div >
<div class="control-container">
<input ref={this.inputElement} t... | harithay/preact-with-inversifyjs-as-di | webapp/src/components/app.tsx | TypeScript |
FunctionDeclaration |
function createProtocolError(error: ProtocolError, method: string, protocolError: { message: string; data: any; }): ProtocolError {
let message = `Protocol error (${method}): ${protocolError.message}`;
if ('data' in protocolError)
message += ` ${protocolError.data}`;
return rewriteErrorMessage(error, message... | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
ArrowFunction |
() => this.emit(ConnectionEvents.Disconnected) | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
this._callbacks.set(id, { resolve, reject, error: new ProtocolError(false), method });
} | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
ArrowFunction |
(error: ProtocolError) => debugLogger.log('error', error) | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
ArrowFunction |
() => {
if (this._eventListener)
this._eventListener(object.method!, object.params);
this.emit(object.method!, object.params);
} | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
ArrowFunction |
() => this.emit(CRSessionEvents.Disconnected) | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
ClassDeclaration |
export class CRConnection extends EventEmitter {
private _lastId = 0;
private readonly _transport: ConnectionTransport;
private readonly _sessions = new Map<string, CRSession>();
private readonly _protocolLogger: ProtocolLogger;
private readonly _browserLogsCollector: RecentLogsCollector;
readonly rootSess... | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
ClassDeclaration |
export class CRSession extends EventEmitter {
_connection: CRConnection | null;
_eventListener?: (method: string, params?: Object) => void;
private readonly _callbacks = new Map<number, {resolve: (o: any) => void, reject: (e: ProtocolError) => void, error: ProtocolError, method: string}>();
private readonly _t... | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
static fromSession(session: CRSession): CRConnection {
return session._connection!;
} | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
session(sessionId: string): CRSession | null {
return this._sessions.get(sessionId) || null;
} | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
_rawSend(sessionId: string, method: string, params: any): number {
const id = ++this._lastId;
const message: ProtocolRequest = { id, method, params };
if (sessionId)
message.sessionId = sessionId;
this._protocolLogger('send', message);
this._transport.send(message);
return id;
} | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
async _onMessage(message: ProtocolResponse) {
this._protocolLogger('receive', message);
if (message.id === kBrowserCloseMessageId)
return;
if (message.method === 'Target.attachedToTarget') {
const sessionId = message.params.sessionId;
const rootSessionId = message.sessionId || '';
c... | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
_onClose() {
this._closed = true;
this._transport.onmessage = undefined;
this._transport.onclose = undefined;
const browserDisconnectedLogs = helper.formatBrowserLogs(this._browserLogsCollector.recentLogs());
for (const session of this._sessions.values())
session._onClosed(browserDisconnected... | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
close() {
if (!this._closed)
this._transport.close();
} | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
async createSession(targetInfo: Protocol.Target.TargetInfo): Promise<CRSession> {
const { sessionId } = await this.rootSession.send('Target.attachToTarget', { targetId: targetInfo.targetId, flatten: true });
return this._sessions.get(sessionId)!;
} | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
async createBrowserSession(): Promise<CRSession> {
const { sessionId } = await this.rootSession.send('Target.attachToBrowserTarget');
return this._sessions.get(sessionId)!;
} | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
_markAsCrashed() {
this._crashed = true;
} | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
async send<T extends keyof Protocol.CommandParameters>(
method: T,
params?: Protocol.CommandParameters[T]
): Promise<Protocol.CommandReturnValues[T]> {
if (this._crashed)
throw new ProtocolError(true, 'Target crashed');
if (this._browserDisconnectedLogs !== undefined)
throw new ProtocolEr... | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
_sendMayFail<T extends keyof Protocol.CommandParameters>(method: T, params?: Protocol.CommandParameters[T]): Promise<Protocol.CommandReturnValues[T] | void> {
return this.send(method, params).catch((error: ProtocolError) => debugLogger.log('error', error));
} | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
_onMessage(object: ProtocolResponse) {
if (object.id && this._callbacks.has(object.id)) {
const callback = this._callbacks.get(object.id)!;
this._callbacks.delete(object.id);
if (object.error)
callback.reject(createProtocolError(callback.error, callback.method, object.error));
else
... | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
async detach() {
if (!this._connection)
throw new Error(`Session already detached. Most likely the ${this._targetType} has been closed.`);
const rootSession = this._connection.session(this._rootSessionId);
if (!rootSession)
throw new Error('Root session has been closed');
await rootSession.... | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
MethodDeclaration |
_onClosed(browserDisconnectedLogs: string | undefined) {
this._browserDisconnectedLogs = browserDisconnectedLogs;
const errorMessage = browserDisconnectedLogs !== undefined ? 'Browser closed.' + browserDisconnectedLogs : 'Target closed';
for (const callback of this._callbacks.values()) {
callback.err... | Meir017/playwright | packages/playwright-core/src/server/chromium/crConnection.ts | TypeScript |
FunctionDeclaration |
export function format(content: string): string {
try {
const tokens = tokenize(content, { range: true });
let result = content;
// 在原来的基础上偏移量
let offset = 0;
tokens.forEach(item => {
if (item.type === 'String' || item.type === 'Identifier') {
l... | wulunyi/typeof-jsonc | src/utils/format.ts | TypeScript |
ArrowFunction |
item => {
if (item.type === 'String' || item.type === 'Identifier') {
let [start, end] = item.range;
start += offset;
end += offset;
const value = item.value;
const singleQReg = /^'(.+)'$/;
const doubleQReg = ... | wulunyi/typeof-jsonc | src/utils/format.ts | TypeScript |
FunctionDeclaration |
function MarketRowItem({
style,
currency,
counterCurrency,
locale,
loading,
isStarred,
toggleStar,
selectCurrency,
availableOnBuy,
availableOnSwap,
}: Props) {
const { t } = useTranslation();
const dispatch = useDispatch();
const openAddAccounts = useCallback(() => {
if (currency)
... | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
ArrowFunction |
() => {
if (currency)
dispatch(
openModal("MODAL_ADD_ACCOUNTS", {
currency: currency.internalCurrency,
preventSkippingCurrencySelection: true,
}),
);
} | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
ArrowFunction |
() => {
selectCurrency(currency.id);
setTrackingSource("Page Market");
history.push({
pathname: `/market/${currency.id}`,
state: currency,
});
} | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
ArrowFunction |
e => {
e.preventDefault();
e.stopPropagation();
setTrackingSource("Page Market");
history.push({
pathname: "/exchange",
state: {
mode: "onRamp",
defaultTicker: currency.ticker.toUpperCase(),
},
});
} | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
ArrowFunction |
e => {
if (currency?.internalCurrency?.id) {
e.preventDefault();
e.stopPropagation();
setTrackingSource("Page Market");
const currencyId = currency?.internalCurrency?.id;
const defaultAccount = getAvailableAccountsById(currencyId, flattenedAccounts).find(
Boole... | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
ArrowFunction |
a => a.id === defaultAccount.parentId | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
ArrowFunction |
e => {
e.preventDefault();
e.stopPropagation();
toggleStar();
} | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
TypeAliasDeclaration |
type Props = {
currency: CurrencyData;
counterCurrency: string;
style: any;
loading: boolean;
locale: string;
isStarred: boolean;
toggleStar: () => void;
selectCurrency: (currencyId: string) => void;
availableOnBuy: boolean;
availableOnSwap: boolean;
}; | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
MethodDeclaration |
t("accounts.contextMenu.buy") | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
MethodDeclaration |
t("accounts.contextMenu.swap") | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
MethodDeclaration |
counterValueFormatter({ value: currency | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
MethodDeclaration |
parseFloat(currency | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
MethodDeclaration |
counterValueFormatter({
shorten: true,
currency: counterCurrency,
value: currency | pawelnguyen/ledger-live-desktop | src/renderer/screens/market/MarketRowItem.tsx | TypeScript |
FunctionDeclaration |
function getKeytip(keytips: IKeytipProps[], content: string): IKeytipProps | undefined {
return find(keytips, (keytip: IKeytipProps) => {
return keytip.content === content;
});
} | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
(keytip: IKeytipProps) => {
return keytip.content === content;
} | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
if (ktpLayer) {
ktpLayer.unmount();
}
} | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
// Add some keytips to the Manager
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdG]: { keytip: keytipG, uniqueID: uniqueIdG },
};
// Create layer
ktpLayer = mount(<KeytipLayerBase content="Alt Windows" />);
const layerKeytips = ktpLayer... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
const onEnter = jest.fn();
const onExit = jest.fn();
beforeEach(() => {
// Add keytips to the manager
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdC]: { keytip: keytipC, uniqueID: uniqueIdC },
[uniqueIdD]: { keytip: keytipD,... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
// Add keytips to the manager
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdC]: { keytip: keytipC, uniqueID: uniqueIdC },
[uniqueIdD]: { keytip: keytipD, uniqueID: uniqueIdD },
};
ktpMgr.persistedKeytips = { [uniqueIdG]: { key... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
// Call enterKeytipMode
ktpMgr.enterKeytipMode();
expect(ktpLayer.state('inKeytipMode')).toEqual(true);
expect(onEnter).toBeCalled();
ktpTree = layerRef.current!.getKeytipTree();
// 4 nodes + the root
expect(Object.keys(ktpTree.nodeMap)).toHaveLength(5);
expect(... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
ktpMgr.shouldEnterKeytipMode = false;
ktpMgr.enterKeytipMode();
expect(ktpLayer.state('inKeytipMode')).toEqual(false);
ktpMgr.shouldEnterKeytipMode = true;
ktpMgr.enterKeytipMode();
expect(ktpLayer.state('inKeytipMode')).toEqual(true);
expect(onEnter).toBeCalled();
... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
let layerValue: KeytipLayerBase;
const onEnter = jest.fn();
const onExit = jest.fn();
describe('processTransitionInput', () => {
describe('with a default layer', () => {
beforeEach(() => {
// Add keytips to the manager
ktpMgr.keytips = {
[uniqueId... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
describe('with a default layer', () => {
beforeEach(() => {
// Add keytips to the manager
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdC]: { keytip: keytipC, uniqueID: uniqueIdC },
[uniqueIdD]: { keytip:... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
beforeEach(() => {
// Add keytips to the manager
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdC]: { keytip: keytipC, uniqueID: uniqueIdC },
[uniqueIdD]: { keytip: keytipD, uniqueID: uniqueIdD },
};
... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
// Add keytips to the manager
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdC]: { keytip: keytipC, uniqueID: uniqueIdC },
[uniqueIdD]: { keytip: keytipD, uniqueID: uniqueIdD },
};
ktpMgr.persistedKe... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
layerValue.processTransitionInput({ key: 'Meta', modifierKeys: [KeyCodes.alt] });
expect(onEnter).toBeCalledWith({ key: 'Meta', modifierKeys: [KeyCodes.alt] });
} | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
ktpTree.currentKeytip = ktpTree.root;
layerValue.processTransitionInput({ key: 'Meta', modifierKeys: [KeyCodes.alt] });
expect(onExit).toBeCalled();
} | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
ktpTree.currentKeytip = ktpTree.root;
layerValue.processTransitionInput({ key: 'Escape' });
expect(onExit).toBeCalled();
} | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
const onReturn: jest.Mock = jest.fn();
const nodeC = ktpTree.getNode(keytipIdC)!;
nodeC.onReturn = onReturn;
ktpTree.currentKeytip = nodeC;
layerValue.processTransitionInput({ key: 'Escape' });
expect(ktpTree.currentKeytip).toEqual(ktpTree.root);
... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
const onReturn: jest.Mock = jest.fn();
const nodeD = ktpTree.getNode(keytipIdD)!;
nodeD.onReturn = onReturn;
ktpTree.currentKeytip = nodeD;
layerValue.processTransitionInput({ key: 'Escape' });
expect(ktpTree.currentKeytip).toEqual(ktpTree.getNode(key... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
// Create layer
ktpLayer = mount(
<KeytipLayerBase
content="Alt Windows"
componentRef={layerRef}
keytipStartSequences={[{ key: 'Meta' }]}
onEnterKeytipMode={onEnter}
/>,
);
layerValue = layerRef.current!;
... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
beforeEach(() => {
// Add keytips to the manager
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdC]: { keytip: keytipC, uniqueID: uniqueIdC },
[uniqueIdD]: { keytip: keytipD, uniqueID: uniqueIdD },
[uniqueIdE1]: { ... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
// Add keytips to the manager
ktpMgr.keytips = {
[uniqueIdB]: { keytip: keytipB, uniqueID: uniqueIdB },
[uniqueIdC]: { keytip: keytipC, uniqueID: uniqueIdC },
[uniqueIdD]: { keytip: keytipD, uniqueID: uniqueIdD },
[uniqueIdE1]: { keytip: keytipE1, uniqueI... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
const onExecute: jest.Mock = jest.fn();
ktpTree.addNode({ ...keytipB, onExecute }, uniqueIdB);
ktpTree.currentKeytip = ktpTree.root;
layerValue.processInput('b');
expect(onExecute).toBeCalled();
expect(onExit).toBeCalled();
expect(layerValue.getCurrentSeq... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
ArrowFunction |
() => {
const onExecuteE2: jest.Mock = jest.fn();
ktpTree.addNode({ ...keytipE2, onExecute: onExecuteE2 }, uniqueIdE2);
ktpTree.currentKeytip = ktpTree.root;
layerValue.processInput('e');
// We are still waiting for second key
expect(layerValue.getCurrentSequence().lengt... | Augani/fluentui | packages/react/src/components/KeytipLayer/KeytipLayer.test.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.