type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
InterfaceDeclaration | /**
* <p>Contains the parameters for SetLoadBalancerListenerSSLCertificate.</p>
*/
export interface SetLoadBalancerListenerSSLCertificateInput {
/**
* <p>The name of the load balancer.</p>
*/
LoadBalancerName: string;
/**
* <p>The port that uses the specified SSL certificate.</p>
*/
LoadBalancerP... | Dylan0916/aws-sdk-js-v3 | clients/browser/client-elastic-load-balancing-browser/types/SetLoadBalancerListenerSSLCertificateInput.ts | TypeScript |
FunctionDeclaration |
export function activate(context: ExtensionContext) {
context.subscriptions.push(commands.registerCommand('catCoding.start', () => {
// Create and show panel
const panel = window.createWebviewPanel('catCoding', 'Cat Coding', ViewColumn.One, { });
// And set its HTML content
panel.w... | Dave-cruzz/vscode-R | src/viewer.ts | TypeScript |
FunctionDeclaration |
function getWebviewContent() {
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cat Coding</title>
</head>
<body>
<img src="https://media.giphy.com/media/JIX9t2j0ZTN9S/giphy.gif" width="300" />
</bod... | Dave-cruzz/vscode-R | src/viewer.ts | TypeScript |
ArrowFunction |
() => {
// Create and show panel
const panel = window.createWebviewPanel('catCoding', 'Cat Coding', ViewColumn.One, { });
// And set its HTML content
panel.webview.html = getWebviewContent();
} | Dave-cruzz/vscode-R | src/viewer.ts | TypeScript |
ArrowFunction |
() => { this.ENEMY_HIT_READY = true } | DusanDimitric/retro-2d-game-engine | src/app/audio/SoundFX.ts | TypeScript |
ClassDeclaration |
export default class SoundFX {
private static SMG: AudioBuffer[] = []
private static SMG_INDEX = 0
private static CRATE_HIT: AudioBuffer[] = []
private static ENEMY_HIT: AudioBuffer[] = []
private static ENEMY_HIT_INDEX = 0
private static ENEMY_HIT_READY: boolean = true
private static ENEMY_DEATH: Aud... | DusanDimitric/retro-2d-game-engine | src/app/audio/SoundFX.ts | TypeScript |
MethodDeclaration |
public static async load(setLoadedPercentage: (percentage: number) => void): Promise<void> {
const soundFxFilePromises = [
load('./audio/smg_1.wav'),
load('./audio/smg_2.wav'),
load('./audio/smg_3.wav'),
load('./audio/smg_4.wav'),
load('./audio/smg_5.wav'),
load('./audio/crate_... | DusanDimitric/retro-2d-game-engine | src/app/audio/SoundFX.ts | TypeScript |
MethodDeclaration |
public static playSMG(): void {
const playSound = context.createBufferSource()
playSound.buffer = this.SMG[this.SMG_INDEX]
const gainNode = context.createGain()
gainNode.gain.value = Mixer.soundFxVolume * 0.2
playSound.connect(gainNode)
gainNode.connect(context.destination)
playSound.sta... | DusanDimitric/retro-2d-game-engine | src/app/audio/SoundFX.ts | TypeScript |
MethodDeclaration |
public static playEnemyHit(): void {
if (this.ENEMY_HIT_READY === false) {
return
}
const playSound = context.createBufferSource()
playSound.buffer = this.ENEMY_HIT[this.ENEMY_HIT_INDEX]
const gainNode = context.createGain()
gainNode.gain.value = Mixer.soundFxVolume
playSound.connect... | DusanDimitric/retro-2d-game-engine | src/app/audio/SoundFX.ts | TypeScript |
MethodDeclaration |
public static playEnemyDeath(): void {
const playSound = context.createBufferSource()
playSound.buffer = this.ENEMY_DEATH[0]
const gainNode = context.createGain()
gainNode.gain.value = Mixer.soundFxVolume
playSound.connect(gainNode)
gainNode.connect(context.destination)
playSound.start()... | DusanDimitric/retro-2d-game-engine | src/app/audio/SoundFX.ts | TypeScript |
MethodDeclaration |
public static playCrateHit(): void {
const playSound = context.createBufferSource()
playSound.buffer = this.CRATE_HIT[0]
const gainNode = context.createGain()
gainNode.gain.value = Mixer.soundFxVolume
playSound.connect(gainNode)
gainNode.connect(context.destination)
playSound.start()
} | DusanDimitric/retro-2d-game-engine | src/app/audio/SoundFX.ts | TypeScript |
ClassDeclaration | /**
* <p>Pause an active App Runner service. App Runner reduces compute capacity for the service to zero and loses state (for example, ephemeral storage is
* removed).</p>
* <p>This is an asynchronous operation. On a successful call, you can use the returned <code>OperationId</code> and the <a>ListOpe... | AllanFly120/aws-sdk-js-v3 | clients/client-apprunner/src/commands/PauseServiceCommand.ts | TypeScript |
InterfaceDeclaration |
export interface PauseServiceCommandInput extends PauseServiceRequest {} | AllanFly120/aws-sdk-js-v3 | clients/client-apprunner/src/commands/PauseServiceCommand.ts | TypeScript |
InterfaceDeclaration |
export interface PauseServiceCommandOutput extends PauseServiceResponse, __MetadataBearer {} | AllanFly120/aws-sdk-js-v3 | clients/client-apprunner/src/commands/PauseServiceCommand.ts | TypeScript |
MethodDeclaration | /**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: AppRunnerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<PauseServiceCommandInput, PauseServiceCommandOutput> {
this.middlewareStack.use(getSerdePlugin(config... | AllanFly120/aws-sdk-js-v3 | clients/client-apprunner/src/commands/PauseServiceCommand.ts | TypeScript |
MethodDeclaration |
private serialize(input: PauseServiceCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_json1_0PauseServiceCommand(input, context);
} | AllanFly120/aws-sdk-js-v3 | clients/client-apprunner/src/commands/PauseServiceCommand.ts | TypeScript |
MethodDeclaration |
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<PauseServiceCommandOutput> {
return deserializeAws_json1_0PauseServiceCommand(output, context);
} | AllanFly120/aws-sdk-js-v3 | clients/client-apprunner/src/commands/PauseServiceCommand.ts | TypeScript |
ClassDeclaration | /**
* Created with https://github.com/flowup/api-client-generator
*/
@Injectable()
export class MetaAPIClient implements MetaAPIClientInterface {
readonly options: APIHttpOptions;
readonly domain: string = `https://api.github.com`;
constructor(private readonly http: HttpClient,
@Optional() @Inj... | MomentumCloud/api-client-generator | tests/github/api/services/meta/meta-api-client.service.ts | TypeScript |
TypeAliasDeclaration |
type APIHttpOptions = HttpOptions & {
headers: HttpHeaders;
params: HttpParams;
}; | MomentumCloud/api-client-generator | tests/github/api/services/meta/meta-api-client.service.ts | TypeScript |
MethodDeclaration | /**
* This gives some information about GitHub.com, the service.
*/
getMeta(
args: {
xGitHubMediaType?: string, // (optional) You can check the current version of media type in responses.
accept?: string, // (optional) Is used to set specified media type.
xRateLimitLimit?: number,
x... | MomentumCloud/api-client-generator | tests/github/api/services/meta/meta-api-client.service.ts | TypeScript |
MethodDeclaration |
private sendRequest<T>(method: string, path: string, options: HttpOptions, body?: any): Observable<T> {
switch (method) {
case 'DELETE':
return this.http.delete<T>(`${this.domain}${path}`, options);
case 'GET':
return this.http.get<T>(`${this.domain}${path}`, options);
case 'HEAD'... | MomentumCloud/api-client-generator | tests/github/api/services/meta/meta-api-client.service.ts | TypeScript |
ArrowFunction |
() => ({
authInfo: null as IAuthInfo | null
}) | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
ArrowFunction |
(role: string): boolean => {
if (this.authInfo === null) return false
role = role.toLowerCase()
return !!this.authInfo.userRoles.find(r => r.toLowerCase() === role)
} | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
ArrowFunction |
r => r.toLowerCase() === role | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
ArrowFunction |
(roles: string[]): boolean => {
if (this.authInfo === null) return false
return this.authInfo.userRoles.some(v => roles.find(r => r.toLowerCase() === v.toLowerCase()))
} | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
ArrowFunction |
v => roles.find(r => r.toLowerCase() === v.toLowerCase()) | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
ArrowFunction |
r => r.toLowerCase() === v.toLowerCase() | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
InterfaceDeclaration |
export interface IAuthInfo {
accessToken: string
accessTokenExpiration: Date | null
userName: string
userRoles: string[]
} | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
MethodDeclaration |
isAuthenticated(): boolean {
if (this.authInfo !== null && this.authInfo.accessToken) {
// check exp
if (new Date() <= (this.authInfo.accessTokenExpiration as Date)) return true
}
return false
} | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
MethodDeclaration |
userName(): string {
return this.authInfo?.userName ?? ''
} | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
MethodDeclaration |
isUserInRole() {
return (role: string): boolean => {
if (this.authInfo === null) return false
role = role.toLowerCase()
return !!this.authInfo.userRoles.find(r => r.toLowerCase() === role)
}
} | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
MethodDeclaration |
isUserInAnyRole() {
return (roles: string[]): boolean => {
if (this.authInfo === null) return false
return this.authInfo.userRoles.some(v => roles.find(r => r.toLowerCase() === v.toLowerCase()))
}
} | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
MethodDeclaration |
updateToken(token: string): void {
const decode = jwt_decode<any>(token)
let role = decode['http://schemas.microsoft.com/ws/2008/06/identity/claims/role']
if (!Array.isArray(role))
role = [role]
this.authInfo = {
accessToken: token,
userName: decode['http://schemas.xmls... | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
MethodDeclaration |
clearToken(): void {
this.authInfo = null
} | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
MethodDeclaration |
login(token: string): void {
this.updateToken(token)
localStorage.setItem('token', token)
} | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
MethodDeclaration |
logout(): void {
this.clearToken()
delete axios.defaults.headers.common.Authorization
localStorage.removeItem('token')
} | JohnCampionJr/Vue3Net6Authentication | src/ClientApp/src/stores/auth.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class CurrentUserMiddleware implements NestMiddleware {
constructor(private usersService: UsersService) {}
async use(req: Request, res: Response, next: NextFunction) {
const { userId } = req.session || {};
if (userId) {
const user = await this.usersService.findOne(userId);
... | saurabhsingh121/nestjs-cal-value | src/users/middlewares/current-user.middleware.ts | TypeScript |
InterfaceDeclaration |
interface Request {
currentUser?: User;
} | saurabhsingh121/nestjs-cal-value | src/users/middlewares/current-user.middleware.ts | TypeScript |
MethodDeclaration |
async use(req: Request, res: Response, next: NextFunction) {
const { userId } = req.session || {};
if (userId) {
const user = await this.usersService.findOne(userId);
req.currentUser = user;
}
next();
} | saurabhsingh121/nestjs-cal-value | src/users/middlewares/current-user.middleware.ts | TypeScript |
ArrowFunction |
(
Network,
waitFor: number,
): Promise<void> => new Promise((resolve) => {
const trackRequests = new Set();
let resolvingTimeout = setTimeout(resolve, waitFor);
Network.requestWillBeSent(({ requestId }) => {
trackRequests.add(requestId);
clearTimeout(resolvingTimeout);
});
Network.loadingFinished(({ reque... | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
(resolve) => {
const trackRequests = new Set();
let resolvingTimeout = setTimeout(resolve, waitFor);
Network.requestWillBeSent(({ requestId }) => {
trackRequests.add(requestId);
clearTimeout(resolvingTimeout);
});
Network.loadingFinished(({ requestId }) => {
trackRequests.delete(requestId);
if (trackReq... | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
({ requestId }) => {
trackRequests.add(requestId);
clearTimeout(resolvingTimeout);
} | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
({ requestId }) => {
trackRequests.delete(requestId);
if (trackRequests.size === 0) {
resolvingTimeout = setTimeout(resolve, waitFor);
}
} | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
(ms: number): Promise<void> => new Promise((resolve) => {
setTimeout(resolve, ms);
}) | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
(resolve) => {
setTimeout(resolve, ms);
} | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
async (
DOM,
contextNodeId: number,
selector: string,
) => await pRetry(
async () => {
const { nodeId } = await DOM.querySelector({
nodeId: contextNodeId,
selector,
});
if (nodeId === 0) {
throw new Error(`Selector "${selector}" not found`);
}
return nodeId as number;
},
{
retries: 3,
on... | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
async () => {
const { nodeId } = await DOM.querySelector({
nodeId: contextNodeId,
selector,
});
if (nodeId === 0) {
throw new Error(`Selector "${selector}" not found`);
}
return nodeId as number;
} | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
async () => await sleep(100) | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
async (
DOM,
query: string,
) => {
const { searchId, resultCount } = await DOM.performSearch({ query });
const { nodeIds } = await DOM.getSearchResults({
searchId,
fromIndex: 0,
toIndex: resultCount,
});
return nodeIds as number[];
} | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
async (
DOM,
nodeId: number,
) => {
await DOM.setAttributeValue({
nodeId,
name: 'style',
value: 'visibility: hidden',
});
} | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
async (
Page,
DOM,
nodeId: number,
) => {
try {
const { model } = await DOM.getBoxModel({ nodeId });
const screenshot = await Page.captureScreenshot({
clip: {
x: 0,
y: 0,
width: model.width,
height: model.height,
scale: 1,
},
});
return Buffer.from(screenshot.data, 'base64');
} ... | privatenumber/snap-tweet | src/cdp-utils.ts | TypeScript |
ArrowFunction |
(data:any)=> {
setTimeout(()=> {
this.smses = data;
}, 0)
} | salwaniza95/GPSChildTracker | src/pages/home/home.ts | TypeScript |
ArrowFunction |
()=> {
this.smses = data;
} | salwaniza95/GPSChildTracker | src/pages/home/home.ts | TypeScript |
ArrowFunction |
(error:any)=> {
alert(error);
} | salwaniza95/GPSChildTracker | src/pages/home/home.ts | TypeScript |
ClassDeclaration | /*
Generated class for the Home page.
See http://ionicframework.com/docs/v2/components/#navigation for more info on
Ionic pages and navigation.
*/
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
public smses:any;
constructor(public navCtrl:NavController, public plat... | salwaniza95/GPSChildTracker | src/pages/home/home.ts | TypeScript |
MethodDeclaration |
ionViewDidLoad() {
console.log('ionViewDidLoad HomePage');
} | salwaniza95/GPSChildTracker | src/pages/home/home.ts | TypeScript |
MethodDeclaration |
getSMS() {
if (window.SMS) window.SMS.listSMS({}, (data:any)=> {
setTimeout(()=> {
this.smses = data;
}, 0)
}, (error:any)=> {
alert(error);
});
} | salwaniza95/GPSChildTracker | src/pages/home/home.ts | TypeScript |
FunctionDeclaration |
export function isSuperbalanced(tree: BinaryTreeNode) {
const nodes = [{ depth: 0, node: tree }];
const leafDepths: number[] = [];
while (nodes.length) {
const { depth, node } = nodes.pop();
if (!node.left && !node.right && !leafDepths.includes(depth)) {
leafDepths.push(depth);
if (Math.max... | adriancarriger/experiments | algorithms/2/src/tree/super-balanced/super-balanced.ts | TypeScript |
ArrowFunction |
async (store: IDocumentStore) => {
const patch = new PatchByQueryOperation(`from Products as p
update {
p.setup = {
fee: 0,
description: ''
}
}`);
const operation = await store.operations.send(patch);
await operation.waitForCompletion();
} | SkyZero1228/node-graphql | src/db/migrations/2018-11-26-PatchProductsWithSetup.ts | TypeScript |
ArrowFunction |
async () => {
console.log('2020-11-26-PatchProductsWithSetup > down');
} | SkyZero1228/node-graphql | src/db/migrations/2018-11-26-PatchProductsWithSetup.ts | TypeScript |
FunctionDeclaration |
export async function revertLiveShareWorkspaceColors() {
await updateWorkspaceConfiguration(peacockColorCustomizations);
peacockColorCustomizations = null;
} | AdilKhn/vscode-peacock | src/live-share/integration.ts | TypeScript |
FunctionDeclaration |
async function setLiveShareSessionWorkspaceColors(isHost: boolean) {
const colorSettingName = isHost
? LiveShareSettings.VSLSShareColor
: LiveShareSettings.VSLSJoinColor;
const liveShareColorSetting = getLiveShareColor(colorSettingName);
if (!liveShareColorSetting) {
return;
}
await applyColor(... | AdilKhn/vscode-peacock | src/live-share/integration.ts | TypeScript |
FunctionDeclaration |
export async function refreshLiveShareSessionColor(isHostRole: boolean): Promise<boolean> {
const vslsApi = await vsls.getApi();
// not in Live Share session, no need to update
if (!vslsApi || !vslsApi.session.id) {
const verb = isHostRole ? 'host and share' : 'join';
notify(`The selected color will be... | AdilKhn/vscode-peacock | src/live-share/integration.ts | TypeScript |
FunctionDeclaration |
export async function addLiveShareIntegration(context: vscode.ExtensionContext) {
State.extensionContext = context;
registerLiveShareIntegrationCommands();
const vslsApi = await vsls.getApi();
await vscode.commands.executeCommand('setContext', 'peacock:liveshare', !!vslsApi);
if (!vslsApi) {
return;
... | AdilKhn/vscode-peacock | src/live-share/integration.ts | TypeScript |
ArrowFunction |
async e => {
// If there isn't a session ID, then that
// means the session has been ended.
if (!e.session.id) {
return await revertLiveShareWorkspaceColors();
}
// we need to update `peacockColorCustomizations` only when it is `undefined`
// to prevent the case of multiple color changes... | AdilKhn/vscode-peacock | src/live-share/integration.ts | TypeScript |
ArrowFunction |
(data: {}) => {
this.persona = data[0];
this.personaldataService.findDataUser('https://servicios.espe.edu.ec:8443/miEspeRPWS-0.0.1-SNAPSHOT/restWs/userldap/',this.userName).subscribe(
data =>{
this.personaldataService.findDataUser('https://miespemovil.espe.edu.ec/reportes/... | crissl/GestonPagosArriendo_Front | .history/src/app/components/sidebar/sidebar.component_20200504111732.ts | TypeScript |
ArrowFunction |
data =>{
this.personaldataService.findDataUser('https://miespemovil.espe.edu.ec/reportes/reporteWs/cedulaById/',data.).subscribe(
data =>{
}
)
} | crissl/GestonPagosArriendo_Front | .history/src/app/components/sidebar/sidebar.component_20200504111732.ts | TypeScript |
ArrowFunction |
data =>{
} | crissl/GestonPagosArriendo_Front | .history/src/app/components/sidebar/sidebar.component_20200504111732.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-sidebar',
templateUrl: './sidebar.component.html',
styleUrls: ['./sidebar.component.css']
})
export class SidebarComponent implements OnInit {
public isLoggedIn = false;
public userName: string;
menuSolicitudes: any[];
menuPlanificaciones: any[];
menuAsistencias: any[];
me... | crissl/GestonPagosArriendo_Front | .history/src/app/components/sidebar/sidebar.component_20200504111732.ts | TypeScript |
InterfaceDeclaration |
declare interface RouteInfo {
path: string;
title: string;
icon: string;
class: string;
} | crissl/GestonPagosArriendo_Front | .history/src/app/components/sidebar/sidebar.component_20200504111732.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.isLoggedIn = this.authService.isLoggedIn();
console.log(this.isLoggedIn);
if (this.isLoggedIn) {
this.userName = this.authService.getUserName();
console.log(this.userName);
this.personaldataService.findDataUser('https://servicios.espe.edu.ec:8443/UPBannerWS-0.0.1-SN... | crissl/GestonPagosArriendo_Front | .history/src/app/components/sidebar/sidebar.component_20200504111732.ts | TypeScript |
MethodDeclaration |
getmenu() {
console.log(atob(localStorage.getItem('iduser')))
if (localStorage.getItem('iduser')) {
this.personaldataService.findDataUser(atob(localStorage.getItem('iduser'))).subscribe(
data => {
console.log(data)
if (data.opciones) {
thi... | crissl/GestonPagosArriendo_Front | .history/src/app/components/sidebar/sidebar.component_20200504111732.ts | TypeScript |
MethodDeclaration |
initialiseInvites(upidm) {
// Set default values and re-fetch any data you need.
// localStorage.getItem('PID');
// //console.log('pidm', btoa(upidm))
localStorage.setItem('pidm', upidm);
// localStorage.getItem('pidm')
} | crissl/GestonPagosArriendo_Front | .history/src/app/components/sidebar/sidebar.component_20200504111732.ts | TypeScript |
ArrowFunction |
props => {
const history = useHistory();
const handlerSearch = (value: string) => {
if (!value) {
return;
}
history.push(`${GLOBAL_SEARCH_PAGE}?${SEARCH_KEY}=${value}`);
};
const prefixCls = getPrefixCls("landing-page");
return (
<EMonitorPage classNam... | PhenixStack/etrace | etrace-ui/src/containers/LandingPage/LandingPage.tsx | TypeScript |
ArrowFunction |
(value: string) => {
if (!value) {
return;
}
history.push(`${GLOBAL_SEARCH_PAGE}?${SEARCH_KEY}=${value}`);
} | PhenixStack/etrace | etrace-ui/src/containers/LandingPage/LandingPage.tsx | TypeScript |
ClassDeclaration | /**
* <p>Updates a Stage.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ApiGatewayV2Client, UpdateStageCommand } from "@aws-sdk/client-apigatewayv2"; // ES Modules import
* // const { ApiGatewayV2Client, UpdateStageCommand } = require("@aws-sdk/c... | Acium-Global/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/UpdateStageCommand.ts | TypeScript |
InterfaceDeclaration |
export interface UpdateStageCommandInput extends UpdateStageRequest {} | Acium-Global/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/UpdateStageCommand.ts | TypeScript |
InterfaceDeclaration |
export interface UpdateStageCommandOutput extends UpdateStageResponse, __MetadataBearer {} | Acium-Global/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/UpdateStageCommand.ts | TypeScript |
MethodDeclaration | /**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: ApiGatewayV2ClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<UpdateStageCommandInput, UpdateStageCommandOutput> {
this.middlewareStack.use(getSerdePlugin(confi... | Acium-Global/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/UpdateStageCommand.ts | TypeScript |
MethodDeclaration |
private serialize(input: UpdateStageCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1UpdateStageCommand(input, context);
} | Acium-Global/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/UpdateStageCommand.ts | TypeScript |
MethodDeclaration |
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UpdateStageCommandOutput> {
return deserializeAws_restJson1UpdateStageCommand(output, context);
} | Acium-Global/aws-sdk-js-v3 | clients/client-apigatewayv2/commands/UpdateStageCommand.ts | TypeScript |
FunctionDeclaration |
function isInRange(range: IRange, index: number): boolean {
return range.start <= index && index < range.end;
} | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
ArrowFunction |
(scrollTop: number) => {
this._render(scrollTop);
} | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
ClassDeclaration |
export class VirtualizedList<TItem extends IObjectWithKey> extends BaseComponent<IVirtualizedListProps<TItem>, IVirtualizedListState> {
public static contextTypes: typeof ScrollContainerContextTypes = ScrollContainerContextTypes;
public context: IScrollContainerContext;
private _root: HTMLElement;
private _s... | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
InterfaceDeclaration |
interface IRange {
/** Start of range */
start: number;
/** Exclusive end of range */
end: number;
} | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
InterfaceDeclaration |
export interface IVirtualizedListState {
viewportHeight: number;
items: React.ReactNode[];
} | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
MethodDeclaration |
public componentDidMount(): void {
this._events.on(this._root, 'focus', this._onFocus, true);
this.context.scrollContainer.registerVisibleCallback((scrollTop: number) => {
this._render(scrollTop);
});
this.componentDidUpdate();
} | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
MethodDeclaration |
public componentDidUpdate(): void {
// (Re-)register with the observer after every update, this way we'll get an intersection event immediately if one of the spacer
// elements is visible right now.
for (const key of Object.keys(this._spacerElements)) {
const ref = this._spacerElements[key];
th... | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
MethodDeclaration |
public componentWillUpdate(): void {
for (const key of Object.keys(this._spacerElements)) {
const ref = this._spacerElements[key];
this.context.scrollContainer.unobserve(ref);
}
} | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
MethodDeclaration |
public render(): JSX.Element {
const { className } = this.props;
const { items } = this.state;
return (
<div
className={ css('ms-VirtualizedList', className) }
ref={ this._resolveRef('_root') }
>
{ items }
</div>
);
} | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
MethodDeclaration |
css('ms-VirtualizedList', className) | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
MethodDeclaration |
private _renderItems(scrollTop: number, viewportHeight: number): (JSX.Element | null)[] {
const {
itemHeight,
items,
itemOverdraw = 2
} = this.props;
let ranges: IRange[] = [];
// Calculate visible range
const startIndex = Math.floor(
Math.max(
scrollTop / itemHeig... | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
MethodDeclaration |
private _renderRanges(ranges: IRange[]): (JSX.Element | null)[] {
const { items, onRenderItem } = this.props;
const result: (JSX.Element | null)[] = [];
// Assume ranges are sorted.
let lastRenderedIndex = -1;
for (const range of ranges) {
// Spacer item before range or between the last ra... | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
MethodDeclaration |
private _renderSpacerItem(numberOfItems: number, index: number): JSX.Element {
const {
itemHeight,
items = [],
spacerItemTagName: ItemTag = 'div'
} = this.props;
const spacerHeight = numberOfItems * itemHeight;
const itemCount = items.length;
let key: string;
if (index === 0... | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
MethodDeclaration |
if (ref) {
this._spacerElements[key] = ref;
} | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
MethodDeclaration |
while (target | Caseyyu2/office-ui-fabric-react | packages/experiments/src/components/VirtualizedList/VirtualizedList.tsx | TypeScript |
ClassDeclaration |
@Module({
providers: [UserService, UserResolver],
exports: [UserService],
})
export class UserModule {} | chaunceyau/nestjs-relay-demo | src/user/user.module.ts | TypeScript |
FunctionDeclaration |
function plural(n: number): number {
let i = Math.floor(Math.abs(n));
if (i === 0 || i === 1) return 1;
return 5;
} | 1Blackdiamondsc/angular | packages/common/locales/fr-GP.ts | TypeScript |
FunctionDeclaration |
function* IdGenerator(prefix: string): IterableIterator<string> {
let number = 1;
let pre = prefix;
while (true) {
yield `${pre}-${number}`;
if (number == Number.MAX_SAFE_INTEGER - 1) {
number = 0;
pre += "x";
}
number++;
}
} | awaigand/ally-hop | src/mixins/id-generator.ts | TypeScript |
MethodDeclaration |
getId(this: any): string {
return idGenerator.next().value;
} | awaigand/ally-hop | src/mixins/id-generator.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.