type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration | // =========
// SYNTHESIS
// =========
protected synthesizeAttributes(): { [name: string]: any } {
return {
policy: cdktf.stringToTerraform(this._policy),
resource_arn: cdktf.stringToTerraform(this._resourceArn),
};
} | terraform-cdk-providers/cdktf-provider-aws | src/networkfirewall/networkfirewall-resource-policy.ts | TypeScript |
FunctionDeclaration |
function ConfirmOrCancel({
disabled = false,
loading = false,
label = "Confirm",
onConfirm,
onCancel,
}: Props) {
return (
<div className="text-center">
<div className="mb-4">
<Button
onClick={onConfirm}
label="Confirm"
fullWidth
primary
d... | getAlby/lightning-browser-extension | src/app/components/ConfirmOrCancel/index.tsx | TypeScript |
TypeAliasDeclaration |
type Props = {
disabled?: boolean;
loading?: boolean;
label?: string;
onConfirm: MouseEventHandler;
onCancel: MouseEventHandler;
}; | getAlby/lightning-browser-extension | src/app/components/ConfirmOrCancel/index.tsx | TypeScript |
ArrowFunction |
(resolve) => {
setTimeout(resolve, ms)
} | Im-Mr-Chris/algomart | apps/web/src/utils/poll.ts | TypeScript |
InterfaceDeclaration |
interface FormUrlArgs {
create?: string; // 新增url
retrieve?: string; // 查询url
update?: string; // 更新url
delete?: string; // 删除url
cou?: string; // 新增或更新url
upload?: string; // 文件上传
} | pengcwl/Ng6Study | src/app/shared/crud/interfaces/form.interface.ts | TypeScript |
InterfaceDeclaration |
export interface FormArgs {
urls?: FormUrlArgs; // crud操作urls
method?: string; // http请求方式,GET/POST
entity?: any; // 存放待提交数据的实体,用于与模版进行数据绑定
params?: any; // 请求参数
key?: string; // 后台接受参数的属性所在的对象路径
uploadKey?: string; // 后台接受file文件的对象路径
} | pengcwl/Ng6Study | src/app/shared/crud/interfaces/form.interface.ts | TypeScript |
FunctionDeclaration |
export function ThemePropertyPane() {
const themingStack = useSelector(getAppThemingStack);
const themingMode = last(themingStack);
/**
* renders the theming property pane:
*
* 1. if THEME_EDIT -> ThemeEditor
* 2. if THEME_SELECTION -> ThemeSelector
*/
const propertyPane = useMemo(() => {
s... | OneToolsCollection/appsmithorg-appsmith | app/client/src/pages/Editor/ThemePropertyPane/index.tsx | TypeScript |
ArrowFunction |
() => {
switch (true) {
case themingMode === AppThemingMode.APP_THEME_EDIT:
return <ThemeEditor />;
case themingMode === AppThemingMode.APP_THEME_SELECTION:
return <ThemeSelector />;
default:
return <ThemeEditor />;
}
} | OneToolsCollection/appsmithorg-appsmith | app/client/src/pages/Editor/ThemePropertyPane/index.tsx | TypeScript |
ClassDeclaration |
export class AdventarClient {
constructor (hostname: string,
credentials: null | { [index: string]: string; },
options: null | { [index: string]: string; });
listCalendars(
request: ListCalendarsRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
... | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
ClassDeclaration |
export class AdventarPromiseClient {
constructor (hostname: string,
credentials: null | { [index: string]: string; },
options: null | { [index: string]: string; });
listCalendars(
request: ListCalendarsRequest,
metadata: grpcWeb.Metadata
): Promise<ListCalendarsResponse>;
... | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
listCalendars(
request: ListCalendarsRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: ListCalendarsResponse) => void
): grpcWeb.ClientReadableStream<ListCalendarsResponse>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
getCalendar(
request: GetCalendarRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: GetCalendarResponse) => void
): grpcWeb.ClientReadableStream<GetCalendarResponse>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
createCalendar(
request: CreateCalendarRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: Calendar) => void
): grpcWeb.ClientReadableStream<Calendar>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
updateCalendar(
request: UpdateCalendarRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: Calendar) => void
): grpcWeb.ClientReadableStream<Calendar>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
deleteCalendar(
request: DeleteCalendarRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: Empty) => void
): grpcWeb.ClientReadableStream<Empty>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
listCalendarStats(
request: ListCalendarStatsRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: ListCalendarStatsResponse) => void
): grpcWeb.ClientReadableStream<ListCalendarStatsResponse>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
listEntries(
request: ListEntriesRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: ListEntriesResponse) => void
): grpcWeb.ClientReadableStream<ListEntriesResponse>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
createEntry(
request: CreateEntryRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: Entry) => void
): grpcWeb.ClientReadableStream<Entry>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
updateEntry(
request: UpdateEntryRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: Entry) => void
): grpcWeb.ClientReadableStream<Entry>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
deleteEntry(
request: DeleteEntryRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: Empty) => void
): grpcWeb.ClientReadableStream<Empty>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
signIn(
request: SignInRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: User) => void
): grpcWeb.ClientReadableStream<User>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
getUser(
request: GetUserRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: User) => void
): grpcWeb.ClientReadableStream<User>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
updateUser(
request: UpdateUserRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: User) => void
): grpcWeb.ClientReadableStream<User>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
healthCheck(
request: HealthCheckRequest,
metadata: grpcWeb.Metadata,
callback: (err: grpcWeb.Error,
response: HealthCheckResponse) => void
): grpcWeb.ClientReadableStream<HealthCheckResponse>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
listCalendars(
request: ListCalendarsRequest,
metadata: grpcWeb.Metadata
): Promise<ListCalendarsResponse>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
getCalendar(
request: GetCalendarRequest,
metadata: grpcWeb.Metadata
): Promise<GetCalendarResponse>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
createCalendar(
request: CreateCalendarRequest,
metadata: grpcWeb.Metadata
): Promise<Calendar>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
updateCalendar(
request: UpdateCalendarRequest,
metadata: grpcWeb.Metadata
): Promise<Calendar>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
deleteCalendar(
request: DeleteCalendarRequest,
metadata: grpcWeb.Metadata
): Promise<Empty>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
listCalendarStats(
request: ListCalendarStatsRequest,
metadata: grpcWeb.Metadata
): Promise<ListCalendarStatsResponse>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
listEntries(
request: ListEntriesRequest,
metadata: grpcWeb.Metadata
): Promise<ListEntriesResponse>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
createEntry(
request: CreateEntryRequest,
metadata: grpcWeb.Metadata
): Promise<Entry>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
updateEntry(
request: UpdateEntryRequest,
metadata: grpcWeb.Metadata
): Promise<Entry>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
deleteEntry(
request: DeleteEntryRequest,
metadata: grpcWeb.Metadata
): Promise<Empty>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
signIn(
request: SignInRequest,
metadata: grpcWeb.Metadata
): Promise<User>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
getUser(
request: GetUserRequest,
metadata: grpcWeb.Metadata
): Promise<User>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
updateUser(
request: UpdateUserRequest,
metadata: grpcWeb.Metadata
): Promise<User>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
MethodDeclaration |
healthCheck(
request: HealthCheckRequest,
metadata: grpcWeb.Metadata
): Promise<HealthCheckResponse>; | adventar/adventar | frontend/lib/grpc/adventar/v1/adventar_grpc_web_pb.d.ts | TypeScript |
FunctionDeclaration |
export default function Form(props: FormProps): JSX.Element {
const { submitButtonText = 'submit', errorMessages = [], onSubmit, className, children, ...formProps } = props;
const [loading, setLoading] = React.useState(false);
function handleSubmit(e) {
setLoading(true);
Promise.resolve(onSubmit(e)).fin... | jtang376/retroquest | ui/src/react/components/form/Form.tsx | TypeScript |
FunctionDeclaration |
function handleSubmit(e) {
setLoading(true);
Promise.resolve(onSubmit(e)).finally(() => setLoading(false));
e.preventDefault();
} | jtang376/retroquest | ui/src/react/components/form/Form.tsx | TypeScript |
ArrowFunction |
(errorMessage, index) => (
<div className="error-message" | jtang376/retroquest | ui/src/react/components/form/Form.tsx | TypeScript |
InterfaceDeclaration |
interface FormProps extends ComponentPropsWithoutRef<'form'> {
errorMessages?: string[];
submitButtonText?: string;
} | jtang376/retroquest | ui/src/react/components/form/Form.tsx | TypeScript |
MethodDeclaration |
classnames('form', className) | jtang376/retroquest | ui/src/react/components/form/Form.tsx | TypeScript |
FunctionDeclaration |
export function EnjoyNotification({
notifications,
toggleNotifications,
}: EnjoyNotificationReduxProps & EnjoyNotificationReduxDispatch): JSX.Element {
const navigation = useNavigation()
const { correct } = useVibrations()
const { bottom } = useSafeAreaWithPadding()
const { colors } = useTheme()
functio... | awaseem/cursor | src/components/notification/screens/enjoyNotification.tsx | TypeScript |
FunctionDeclaration |
function onExit(): void {
navigation.goBack()
} | awaseem/cursor | src/components/notification/screens/enjoyNotification.tsx | TypeScript |
FunctionDeclaration |
function onHold(): void {
requestReview()
navigation.goBack()
} | awaseem/cursor | src/components/notification/screens/enjoyNotification.tsx | TypeScript |
InterfaceDeclaration |
export interface EnjoyNotificationReduxProps {
readonly notifications: boolean
} | awaseem/cursor | src/components/notification/screens/enjoyNotification.tsx | TypeScript |
InterfaceDeclaration |
export interface EnjoyNotificationReduxDispatch {
readonly toggleNotifications: (value: boolean) => void
} | awaseem/cursor | src/components/notification/screens/enjoyNotification.tsx | TypeScript |
ArrowFunction |
(entry) => {
const [key, value] = entry
const val: { answer: string, questions: string[]}[] = Object.entries(value).map((ans) => {
return { answer: ans[0], questions: ans[1] }
})
val.sort((a, b) => b.questions.length - a.questions.length)
return [key, val]
} | Holy-Spirit-Scholar-Bowl/practice | src/store/index.ts | TypeScript |
ArrowFunction |
(ans) => {
return { answer: ans[0], questions: ans[1] }
} | Holy-Spirit-Scholar-Bowl/practice | src/store/index.ts | TypeScript |
ArrowFunction |
(a, b) => b.questions.length - a.questions.length | Holy-Spirit-Scholar-Bowl/practice | src/store/index.ts | TypeScript |
ArrowFunction |
(e) => !this.excludeFilter.length || this.exclude !== !this.excludeFilter.includes(e.answer) | Holy-Spirit-Scholar-Bowl/practice | src/store/index.ts | TypeScript |
ArrowFunction |
(question) => question.answer | Holy-Spirit-Scholar-Bowl/practice | src/store/index.ts | TypeScript |
ClassDeclaration |
export class PracticeModule extends VuexModule {
constructor () {
super()
this.frequencyLists = Object.fromEntries(Object.entries(freqLists).map((entry) => {
const [key, value] = entry
const val: { answer: string, questions: string[]}[] = Object.entries(value).map((ans) => {
return { ans... | Holy-Spirit-Scholar-Bowl/practice | src/store/index.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class UserService extends UserData {
private time: Date = new Date;
private users = {
nick: { name: 'Utilisateur', picture: 'assets/user.svg' },
eva: { name: 'Eva Moor', picture: 'assets/images/eva.png' },
jack: { name: 'Jack Williams', picture: 'assets/images/jack.png' },
le... | ettouzany/electronjs-angular | src/app/@core/mock/users.service.ts | TypeScript |
MethodDeclaration |
getUsers(): Observable<any> {
return observableOf(this.users);
} | ettouzany/electronjs-angular | src/app/@core/mock/users.service.ts | TypeScript |
MethodDeclaration |
getContacts(): Observable<Contacts[]> {
return observableOf(this.contacts);
} | ettouzany/electronjs-angular | src/app/@core/mock/users.service.ts | TypeScript |
MethodDeclaration |
getRecentUsers(): Observable<RecentUsers[]> {
return observableOf(this.recentUsers);
} | ettouzany/electronjs-angular | src/app/@core/mock/users.service.ts | TypeScript |
ArrowFunction |
() => CasPortionType | ehsanmandegar/kafka-agent | src/entities/cas-pay-off-portion.ts | TypeScript |
ArrowFunction |
(casPortionType) => casPortionType.casPayOffPortions | ehsanmandegar/kafka-agent | src/entities/cas-pay-off-portion.ts | TypeScript |
ArrowFunction |
(casPayOffPortion: CasPayOffPortion) => casPayOffPortion.fkfPortionType | ehsanmandegar/kafka-agent | src/entities/cas-pay-off-portion.ts | TypeScript |
ClassDeclaration |
@Index('PK_casPayOffPortion', ['pkfPayOffPortion'], { unique: true })
@Entity('casPayOffPortion', { schema: 'dbo' })
export class CasPayOffPortion {
@PrimaryGeneratedColumn({ type: 'int', name: 'pkfPayOffPortion' })
pkfPayOffPortion: number;
@Column('bigint', { name: 'payOff' })
payOff: string;
@Column('nv... | ehsanmandegar/kafka-agent | src/entities/cas-pay-off-portion.ts | TypeScript |
ArrowFunction |
(user) => user.username === input || user.addresses.includes(input) | useverto/js | src/user.ts | TypeScript |
ArrowFunction |
({ pair, orders }) =>
orders
.map((order) => ({
id: order.id,
owner: order.creator,
pair,
price: order.price,
filled: order.originalQuantity - order.quantity,
quantity: order.originalQuantity,
}))
.filter(({ o... | useverto/js | src/user.ts | TypeScript |
ArrowFunction |
(order) => ({
id: order.id,
owner: order.creator,
pair,
price: order.price,
filled: order.originalQuantity - order.quantity,
quantity: order.originalQuantity,
}) | useverto/js | src/user.ts | TypeScript |
ArrowFunction |
({ owner }) => owner === address | useverto/js | src/user.ts | TypeScript |
ArrowFunction |
(tx) => tx.node.id === after | useverto/js | src/user.ts | TypeScript |
ArrowFunction |
({ id }) => id === node.id | useverto/js | src/user.ts | TypeScript |
ArrowFunction |
(tag) => tag.name === "Input" | useverto/js | src/user.ts | TypeScript |
ArrowFunction |
(a, b) =>
(b.timestamp ||
parseFloat(new Date().getTime().toString().substring(0, 10))) -
(a.timestamp ||
parseFloat(new Date().getTime().toString().substring(0, 10))) | useverto/js | src/user.ts | TypeScript |
MethodDeclaration | /**
* Fetches the user info for a given wallet address or username.
* @param input User wallet address or username.
* @returns The user's data such as name & image, or undefined.
*/
async getUser(input: string): Promise<UserInterface | undefined> {
let allUsers: CommunityContractPeople[];
if (this.... | useverto/js | src/user.ts | TypeScript |
MethodDeclaration | /**
* Fetches the assets (listed on Verto) for a given wallet address.
* @param address User wallet address.
* @returns List of asset ids, balances, names, tickers, & logos.
*/
async getBalances(address: string): Promise<UserBalance[]> {
if (!this.cache) {
const balances: UserBalance[] = [];
... | useverto/js | src/user.ts | TypeScript |
MethodDeclaration | /**
* Fetches the orders for a given wallet address
* @param address User wallet address
* @returns List of orders
*/
async getOrders(address: string): Promise<OrderInterface[]> {
// get clob contract state
const clobContractState: {
[key: string]: any;
pairs: {
pair: [string, st... | useverto/js | src/user.ts | TypeScript |
MethodDeclaration | /**
* Fetches the latest transactions for a given wallet address.
* @param address User wallet address.
* @param after Optional latest transaction id, used for pagination.
* @returns List of transaction ids, statuses, amounts, & timestamps.
*/
async getTransactions(
address: string,
after?: strin... | useverto/js | src/user.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class Playlist {
songs: Song[];
constructor(songsService: SongsService) {
this.songs = songsService.fetch();
}
} | PacktPublishing/Angular-5-Fundamentals | Section 05/ModuleExample/src/app/music/playlist.service.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy) {
constructor(
@InjectRepository(UserRepository)
private userRepository: UserRepository,
) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
secretOrKey: process.env.JWT_S... | abhishekpabba/task-management-nestjs | src/auth/jwt.strategy.ts | TypeScript |
MethodDeclaration |
async validate(payload: JwtPayload): Promise<User> {
const { username } = payload;
const user = await this.userRepository.findOne({ username });
if (!user) {
throw new UnauthorizedException();
}
return user;
} | abhishekpabba/task-management-nestjs | src/auth/jwt.strategy.ts | TypeScript |
FunctionDeclaration |
function ConfirmPage(): ReactElement {
return (
<Layout title="Confirm Account">
<h1>Cannot confirm user account, invalid token </h1>
</Layout>
);
} | tolgaerdonmez/typegraphql-nextjs-example-auth | client/pages/user/confirm/[token].tsx | TypeScript |
ArrowFunction |
async ({ apolloClient, query: { token }, ...ctx }: DefaultContext) => {
try {
const { data } = await apolloClient.mutate<ConfirmUserMutation, ConfirmUserMutationVariables>({
mutation: confirmUserMutation,
variables: { token: token as string },
});
if (data?.confirmUser) {
redirect(ctx, "/user/login");... | tolgaerdonmez/typegraphql-nextjs-example-auth | client/pages/user/confirm/[token].tsx | TypeScript |
TypeAliasDeclaration | /** Callback to inform of a value updates. */
export type StoreSubscriber<T> = (value: T) => void; | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration | /** Unsubscribes from value updates. */
export type StoreUnsubscriber = () => void; | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration | /** Callback to update a value. */
export type StoreUpdater<T> = (value: T) => T; | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration | /** Cleanup logic callback. */
export type StoreInvalidator<T> = (value?: T) => void; | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration | /** Start and stop notification callbacks. */
export type StoreStartStopNotifier<T> = (set: StoreSubscriber<T>) => StoreUnsubscriber | void; | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration | /** Readable interface for subscribing. */
export type ReadableStore<T> = {
initialValue: T | undefined;
/**
* Subscribe on value changes.
* @param run - subscription callback
* @param invalidate - cleanup callback
*/
subscribe(
this: void,
run: StoreSubscriber<T>,
invalidate?: StoreInval... | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration | /** Writable interface for both updating and subscribing. */
export type WritableStore<T> = ReadableStore<T> & {
/**
* Set value and inform subscribers.
* @param value - to set
*/
set(this: void, value: T): void;
/**
* Update value using callback and inform subscribers.
* @param updater - callback... | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration | /** Pair of subscriber and invalidator. */
export type SubscribeInvalidateTuple<T> = [StoreSubscriber<T>, StoreInvalidator<T>]; | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration |
export type ReadableStoreRecord = {
[prop: string]: ReadableStore<any>;
}; | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration |
export type WritableStoreRecord = {
[prop: string]: WritableStore<any>;
}; | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration |
export type StoreValue<T> = T extends ReadableStore<infer U> ? U : never; | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration | /** One or more `Readable`s. */
export type Stores =
| ReadableStore<any>
| [ReadableStore<any>, ...Array<ReadableStore<any>>]
| Array<ReadableStore<any>>; | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
TypeAliasDeclaration | /** One or more values from `Readable` stores. */
export type StoresValues<T> = T extends ReadableStore<infer U>
? U
: { [K in keyof T]: T[K] extends ReadableStore<infer U> ? U : never }; | Hashen110/vidstack | packages/foundation/src/stores/types.ts | TypeScript |
FunctionDeclaration |
function getGrantWrapperContentProps (grantType: PromotionType): GrantWrapperContentProps {
if (grantType === 'ads') {
return {
title: getLocale('grantTitleAds'),
text: getLocale('grantSubtitleAds')
}
}
return {
title: getLocale('grantTitleUGP'),
text: getLocale('grantSubtitleUGP')
... | 0xedward/brave-core | components/brave_rewards/resources/android_page/components/promotion.tsx | TypeScript |
FunctionDeclaration |
function getGrantCompleteContentProps (grantType: PromotionType): GrantCompleteContentProps {
if (grantType === 'ads') {
return {
amountTitleText: getLocale('grantAmountTitleAds'),
dateTitleText: getLocale('grantDateTitleAds')
}
}
return {
amountTitleText: getLocale('grantAmountTitleUGP')... | 0xedward/brave-core | components/brave_rewards/resources/android_page/components/promotion.tsx | TypeScript |
ArrowFunction |
(promotionId?: string) => {
this.setState({ loading: true })
this.actions.claimPromotion(promotionId)
this.setState({ promotionStep: 'complete' })
} | 0xedward/brave-core | components/brave_rewards/resources/android_page/components/promotion.tsx | TypeScript |
ArrowFunction |
(promotionId: string) => {
this.setState({
promotionShow: false,
promotionStep: '',
loading: false
})
this.actions.deletePromotion(promotionId)
} | 0xedward/brave-core | components/brave_rewards/resources/android_page/components/promotion.tsx | TypeScript |
ArrowFunction |
(tokens?: string) => {
const { promotion } = this.props
const { safetyNetFailed } = this.props.rewardsData
if (!tokens || !promotion) {
return false
}
if (safetyNetFailed) {
this.setState({ loading: false })
return false
}
// Promotion types other than Rewards.Promotion... | 0xedward/brave-core | components/brave_rewards/resources/android_page/components/promotion.tsx | TypeScript |
ArrowFunction |
(state: Rewards.ApplicationState) => ({
rewardsData: state.rewardsData
}) | 0xedward/brave-core | components/brave_rewards/resources/android_page/components/promotion.tsx | TypeScript |
ArrowFunction |
(dispatch: Dispatch) => ({
actions: bindActionCreators(rewardsActions, dispatch)
}) | 0xedward/brave-core | components/brave_rewards/resources/android_page/components/promotion.tsx | TypeScript |
ClassDeclaration | // TODO add local when we know what we will get from the server
class Promotion extends React.Component<Props, State> {
constructor (props: Props) {
super(props)
this.state = {
promotionShow: true,
promotionStep: '',
loading: false
}
}
get actions () {
return this.props.actions
... | 0xedward/brave-core | components/brave_rewards/resources/android_page/components/promotion.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.