type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
|---|---|---|---|---|
EnumDeclaration
|
export enum BatchContext { }
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
EnumDeclaration
|
export enum SliceContext { }
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
EnumDeclaration
|
export enum SnapshotContext { }
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
EnumDeclaration
|
export enum IteratorContext { }
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
EnumDeclaration
|
export enum DatabaseContext { }
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
EnumDeclaration
|
export enum OptionsContext { }
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
EnumDeclaration
|
export enum ReadOptionsContext { }
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
EnumDeclaration
|
export enum WriteOptionsContext { }
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
EnumDeclaration
|
export enum IteratorStatusCode {
Ok = 0,
NotFound = 1,
Corruption = 2,
NotSupported = 3,
InvalidArgument = 4,
IOError = 5,
MergeInProgress = 6,
Incomplete = 7,
ShutdownInProgress = 8,
TimedOut = 9,
Aborted = 10,
Busy = 11,
Expired = 12,
TryAgain = 13,
CompactionTooLarge = 14
}
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
EnumDeclaration
|
export enum IteratorStatusSubcode {
None = 0,
MutexTimeout = 1,
LockTimeout = 2,
LockLimit = 3,
NoSpace = 4,
Deadlock = 5,
StaleFile = 6,
MemoryLimit = 7,
MaxSubCode
}
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
EnumDeclaration
|
export enum ReadOptionsReadTier {
ReadAllTier = 0x0,
BlockCacheTier = 0x1,
PersistedTier = 0x2,
MemtableTier = 0x3
}
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type Callback = (error: Error) => void;
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type CallbackWithValue<V> = (error: Error, value: V) => void;
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type CallbackWithKeyValue<K, V> = (error: Error, key: K, value: V) => void;
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type Unique<T> = T & { readonly '': unique symbol };
|
lu4/rocksdb-ts
|
src/binding.ts
|
TypeScript
|
ClassDeclaration
|
export default class PraiseGraduationCapHC extends BaseIllustration {
public render() {
return (
<svg
viewBox="0 0 72 72"
height="72"
width="72"
className={this.getClassName()}
aria-hidden="true"
tabIndex={-1}
focusable="false"
>
<circle cx="-34.889" cy="37.078" r="35.994" transform="rotate(-88.267)" />
<path fill="#fff" d="M36.014 0v1.104h1.055c9.311.288 17.95 4.175 24.333 10.943 6.384 6.767 9.743 15.646 9.455 24.956C70.57 46.123 66.826 54.665 60.25 61c-6.527 6.384-15.118 9.887-24.236 9.887h-1.056c-9.311-.288-17.95-4.175-24.333-10.942C4.194 53.129.834 44.25 1.122 34.94c.288-9.12 4.031-17.662 10.607-23.997 6.575-6.335 15.166-9.839 24.285-9.839V0m0 0C16.624 0 .642 15.406.018 34.892-.606 54.762 15.04 71.367 34.91 71.943h1.104c19.39 0 35.371-15.406 35.947-34.892C72.585 17.182 56.939.576 37.069.001z" />
<path fill="#fff" d="M54.683 45.258c0 5.664-7.823 10.271-17.422 10.271-9.598 0-17.421-4.607-17.421-10.27v-10.32l34.843-.863z" />
<path fill="#fff" d="M37.261 17.758l-27.5 15.406 27.5 15.406L64.81 33.164z" />
<path d="M37.261 17.758L64.81 33.164 37.31 48.57 9.76 33.164l27.501-15.406m0-1.872c-.288 0-.624.096-.912.24L8.897 31.532c-.576.336-.96.96-.96 1.584 0 .624.336 1.296.96 1.584l27.5 15.406c.288.144.576.24.912.24.336 0 .624-.096.912-.24l27.5-15.406c.577-.336.96-.96.96-1.584 0-.624-.335-1.296-.96-1.584L38.174 16.126c-.288-.144-.576-.24-.912-.24z"
|
Bhaskers-Blu-Org2/YamUI
|
src/components/Illustration/illustrations/PraiseGraduationCapHC72.tsx
|
TypeScript
|
MethodDeclaration
|
public render() {
return (
<svg
viewBox="0 0 72 72"
height="72"
width="72"
className={this.getClassName()}
aria-hidden="true"
tabIndex={-1}
|
Bhaskers-Blu-Org2/YamUI
|
src/components/Illustration/illustrations/PraiseGraduationCapHC72.tsx
|
TypeScript
|
ArrowFunction
|
() => {
return domReady.version;
}
|
0-Captain/DefinitelyTyped
|
types/requirejs-domready/requirejs-domready-tests.ts
|
TypeScript
|
ArrowFunction
|
(): void => {
while (argv.length > 0) {
let currentArgument: string = argv.shift()!;
// When an flag appears, the corresponding option will be true.
// Unless the flag comes with the "--table=false" form
let currentValue = true;
const indexOfEqualSign: number = currentArgument.indexOf('=');
if (indexOfEqualSign !== -1) {
// The flag appeared with the "--table=false" form
const aux = currentArgument.split('=');
currentArgument = aux[0]!;
// Anything that isn't "true" will be ignored
// and the value will be the default (false)
currentValue = aux[1]!.toLowerCase() === 'true';
}
// Flag to catch the path and unknown options
let isOption = false;
if (/-(-table|[tsahv]*t[tsahv]*)$/.test(currentArgument)) {
isOption = true;
options.table = currentValue;
}
if (/-(-sort|[tsahv]*s[tsahv]*)$/.test(currentArgument)) {
isOption = true;
const aux: string = argv.shift()!;
if (typeof aux === 'undefined') {
throw new TypeError('The sort option require to specify an engine');
}
options.sort = aux;
}
if (/-(-add|[tsahv]*a[tsahv]*)$/.test(currentArgument)) {
isOption = true;
options.add = currentValue;
}
if (/-(-help|[tsahv]*h[tsahv]*)$/.test(currentArgument)) {
isOption = true;
options.help = currentValue;
}
if (/-(-version|[tsahv]*v[tsahv]*)$/.test(currentArgument)) {
isOption = true;
options.version = currentValue;
}
// The argument isn't an option or is composed of an unknown option
if (!isOption) {
if (currentArgument.startsWith('-')) {
throw new Error(`Invalid option "${currentArgument}"`);
}
path = currentArgument;
}
}
// eslint-disable-next-line @typescript-eslint/no-use-before-define
if (options.help) return printHelp();
if (options.version) return console.log(`v${version}`);
// We calls getPackages to a later table display
const packages = getPackages(path, options.sort);
const result = enginesLookup(packages);
if (options.table) {
console.table(
packages.map((x) => ({
package: `${x.name}@${x.version}`,
engines: x.engines,
}))
);
}
if (options.add) {
const packageJson = JSON.parse(
readFileSync(`${path}/package.json`, { encoding: 'utf-8' })
);
writeFileSync(
`${path}/package.json`,
// It uses Prettier's default tabWidth
JSON.stringify({ ...packageJson, engines: result }, null, 2)
);
}
return console.log(
`The used engines are:\n${JSON.stringify(result, null, 2)}`
);
}
|
gonza7aav/engines-lookup
|
src/bin/engines-lookup.ts
|
TypeScript
|
ArrowFunction
|
(x) => ({
package: `${x.name}@${x.version}`,
engines: x.engines,
})
|
gonza7aav/engines-lookup
|
src/bin/engines-lookup.ts
|
TypeScript
|
ArrowFunction
|
(): void => console.log(
`engines-lookup v${version}
A tool to check what engines are advised by the dependencies
Usage: engines-lookup [options] [path]
If a path isn't provided, the program will use "."
Options:
-t, --table
Shows a table of package's name and advised engines. Default: false
-s, --sort <engine>
Sorts the table entries by the engine specified. The first entry will
always be the project at the path. Default: "node"
-a, --add
Adds the result to the project's package.json file. Default: false
-v, --version
Displays the current version of engines-lookup
-h, --help
Shows this help message`)
|
gonza7aav/engines-lookup
|
src/bin/engines-lookup.ts
|
TypeScript
|
FunctionDeclaration
|
export function useOnCommentAddedSubscription<TData = OnCommentAddedSubscription>(
options: Omit<Urql.UseSubscriptionArgs<OnCommentAddedSubscriptionVariables>, 'query'> = {},
handler?: Urql.SubscriptionHandler<OnCommentAddedSubscription, TData>
) {
return Urql.useSubscription<OnCommentAddedSubscription, TData, OnCommentAddedSubscriptionVariables>(
{ query: OnCommentAddedDocument, ...options },
handler
);
}
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
FunctionDeclaration
|
export function useCommentQuery(options: Omit<Urql.UseQueryArgs<CommentQueryVariables>, 'query'> = {}) {
return Urql.useQuery<CommentQuery>({ query: CommentDocument, ...options });
}
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
FunctionDeclaration
|
export function useCurrentUserForProfileQuery(
options: Omit<Urql.UseQueryArgs<CurrentUserForProfileQueryVariables>, 'query'> = {}
) {
return Urql.useQuery<CurrentUserForProfileQuery>({ query: CurrentUserForProfileDocument, ...options });
}
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
FunctionDeclaration
|
export function useFeedQuery(options: Omit<Urql.UseQueryArgs<FeedQueryVariables>, 'query'> = {}) {
return Urql.useQuery<FeedQuery>({ query: FeedDocument, ...options });
}
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
FunctionDeclaration
|
export function useSubmitRepositoryMutation() {
return Urql.useMutation<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(SubmitRepositoryDocument);
}
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
FunctionDeclaration
|
export function useSubmitCommentMutation() {
return Urql.useMutation<SubmitCommentMutation, SubmitCommentMutationVariables>(SubmitCommentDocument);
}
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
FunctionDeclaration
|
export function useVoteMutation() {
return Urql.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument);
}
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
EnumDeclaration
|
/** A list of options for the sort order of the feed */
export enum FeedType {
/** Sort by a combination of freshness and score, using Reddit's algorithm */
Hot = 'HOT',
/** Newest entries first */
New = 'NEW',
/** Highest score entries first */
Top = 'TOP',
}
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
EnumDeclaration
|
/** The type of vote to record, when submitting a vote */
export enum VoteType {
Cancel = 'CANCEL',
Down = 'DOWN',
Up = 'UP',
}
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type Maybe<T> = T | null;
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
String: string;
Boolean: boolean;
Int: number;
Float: number;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
/** A comment about an entry, submitted by a user */
export type Comment = {
__typename?: 'Comment';
/** The text of the comment */
content: Scalars['String'];
/** A timestamp of when the comment was posted */
createdAt: Scalars['Float'];
/** The SQL ID of this entry */
id: Scalars['Int'];
/** The GitHub user who posted the comment */
postedBy: User;
/** The repository which this comment is about */
repoName: Scalars['String'];
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
/** Information about a GitHub repository submitted to GitHunt */
export type Entry = {
__typename?: 'Entry';
/** The number of comments posted about this repository */
commentCount: Scalars['Int'];
/** Comments posted about this repository */
comments: Array<Maybe<Comment>>;
/** A timestamp of when the entry was submitted */
createdAt: Scalars['Float'];
/** The hot score of this repository */
hotScore: Scalars['Float'];
/** The SQL ID of this entry */
id: Scalars['Int'];
/** The GitHub user who submitted this entry */
postedBy: User;
/** Information about the repository from GitHub */
repository: Repository;
/** The score of this repository, upvotes - downvotes */
score: Scalars['Int'];
/** XXX to be changed */
vote: Vote;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
/** Information about a GitHub repository submitted to GitHunt */
export type EntryCommentsArgs = {
limit?: Maybe<Scalars['Int']>;
offset?: Maybe<Scalars['Int']>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type Mutation = {
__typename?: 'Mutation';
/** Comment on a repository, returns the new comment */
submitComment?: Maybe<Comment>;
/** Submit a new repository, returns the new submission */
submitRepository?: Maybe<Entry>;
/** Vote on a repository submission, returns the submission that was voted on */
vote?: Maybe<Entry>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type MutationSubmitCommentArgs = {
commentContent: Scalars['String'];
repoFullName: Scalars['String'];
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type MutationSubmitRepositoryArgs = {
repoFullName: Scalars['String'];
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type MutationVoteArgs = {
repoFullName: Scalars['String'];
type: VoteType;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type Query = {
__typename?: 'Query';
/** Return the currently logged in user, or null if nobody is logged in */
currentUser?: Maybe<User>;
/** A single entry */
entry?: Maybe<Entry>;
/** A feed of repository submissions */
feed?: Maybe<Array<Maybe<Entry>>>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type QueryEntryArgs = {
repoFullName: Scalars['String'];
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type QueryFeedArgs = {
limit?: Maybe<Scalars['Int']>;
offset?: Maybe<Scalars['Int']>;
type: FeedType;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
/**
* A repository object from the GitHub API. This uses the exact field names returned by the
* GitHub API for simplicity, even though the convention for GraphQL is usually to camel case.
*/
export type Repository = {
__typename?: 'Repository';
/** The description of the repository */
description?: Maybe<Scalars['String']>;
/** The full name of the repository with the username, e.g. apollostack/GitHunt-API */
full_name: Scalars['String'];
/** The link to the repository on GitHub */
html_url: Scalars['String'];
/** Just the name of the repository, e.g. GitHunt-API */
name: Scalars['String'];
/** The number of open issues on this repository on GitHub */
open_issues_count?: Maybe<Scalars['Int']>;
/** The owner of this repository on GitHub, e.g. apollostack */
owner?: Maybe<User>;
/** The number of people who have starred this repository on GitHub */
stargazers_count: Scalars['Int'];
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type Subscription = {
__typename?: 'Subscription';
/** Subscription fires on every comment added */
commentAdded?: Maybe<Comment>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type SubscriptionCommentAddedArgs = {
repoFullName: Scalars['String'];
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
/** A user object from the GitHub API. This uses the exact field names returned from the GitHub API. */
export type User = {
__typename?: 'User';
/** The URL to a directly embeddable image for this user's avatar */
avatar_url: Scalars['String'];
/** The URL of this user's GitHub page */
html_url: Scalars['String'];
/** The name of the user, e.g. apollostack */
login: Scalars['String'];
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
/** XXX to be removed */
export type Vote = {
__typename?: 'Vote';
vote_value: Scalars['Int'];
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type OnCommentAddedSubscriptionVariables = Exact<{
repoFullName: Scalars['String'];
}>;
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type OnCommentAddedSubscription = {
__typename?: 'Subscription';
commentAdded?: Maybe<{
__typename?: 'Comment';
id: number;
createdAt: number;
content: string;
postedBy: { __typename?: 'User'; login: string; html_url: string };
}>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type CommentQueryVariables = Exact<{
repoFullName: Scalars['String'];
limit?: Maybe<Scalars['Int']>;
offset?: Maybe<Scalars['Int']>;
}>;
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type CommentQuery = {
__typename?: 'Query';
currentUser?: Maybe<{ __typename?: 'User'; login: string; html_url: string }>;
entry?: Maybe<{
__typename?: 'Entry';
id: number;
createdAt: number;
commentCount: number;
postedBy: { __typename?: 'User'; login: string; html_url: string };
comments: Array<
Maybe<{
__typename?: 'Comment';
id: number;
createdAt: number;
content: string;
postedBy: { __typename?: 'User'; login: string; html_url: string };
}>
>;
repository: {
__typename?: 'Repository';
description?: Maybe<string>;
open_issues_count?: Maybe<number>;
stargazers_count: number;
full_name: string;
html_url: string;
};
}>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type CommentsPageCommentFragment = {
__typename?: 'Comment';
id: number;
createdAt: number;
content: string;
postedBy: { __typename?: 'User'; login: string; html_url: string };
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type CurrentUserForProfileQueryVariables = Exact<{ [key: string]: never }>;
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type CurrentUserForProfileQuery = {
__typename?: 'Query';
currentUser?: Maybe<{ __typename?: 'User'; login: string; avatar_url: string }>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type FeedEntryFragment = {
__typename?: 'Entry';
id: number;
commentCount: number;
score: number;
createdAt: number;
repository: {
__typename?: 'Repository';
full_name: string;
html_url: string;
description?: Maybe<string>;
stargazers_count: number;
open_issues_count?: Maybe<number>;
owner?: Maybe<{ __typename?: 'User'; avatar_url: string }>;
};
vote: { __typename?: 'Vote'; vote_value: number };
postedBy: { __typename?: 'User'; html_url: string; login: string };
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type FeedQueryVariables = Exact<{
type: FeedType;
offset?: Maybe<Scalars['Int']>;
limit?: Maybe<Scalars['Int']>;
}>;
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type FeedQuery = {
__typename?: 'Query';
currentUser?: Maybe<{ __typename?: 'User'; login: string }>;
feed?: Maybe<
Array<
Maybe<{
__typename?: 'Entry';
id: number;
commentCount: number;
score: number;
createdAt: number;
repository: {
__typename?: 'Repository';
full_name: string;
html_url: string;
description?: Maybe<string>;
stargazers_count: number;
open_issues_count?: Maybe<number>;
owner?: Maybe<{ __typename?: 'User'; avatar_url: string }>;
};
vote: { __typename?: 'Vote'; vote_value: number };
postedBy: { __typename?: 'User'; html_url: string; login: string };
}>
>
>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type SubmitRepositoryMutationVariables = Exact<{
repoFullName: Scalars['String'];
}>;
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type SubmitRepositoryMutation = {
__typename?: 'Mutation';
submitRepository?: Maybe<{ __typename?: 'Entry'; createdAt: number }>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type RepoInfoFragment = {
__typename?: 'Entry';
createdAt: number;
repository: {
__typename?: 'Repository';
description?: Maybe<string>;
stargazers_count: number;
open_issues_count?: Maybe<number>;
};
postedBy: { __typename?: 'User'; html_url: string; login: string };
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type SubmitCommentMutationVariables = Exact<{
repoFullName: Scalars['String'];
commentContent: Scalars['String'];
}>;
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type SubmitCommentMutation = {
__typename?: 'Mutation';
submitComment?: Maybe<{
__typename?: 'Comment';
id: number;
createdAt: number;
content: string;
postedBy: { __typename?: 'User'; login: string; html_url: string };
}>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type VoteButtonsFragment = {
__typename?: 'Entry';
score: number;
vote: { __typename?: 'Vote'; vote_value: number };
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type VoteMutationVariables = Exact<{
repoFullName: Scalars['String'];
type: VoteType;
}>;
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type VoteMutation = {
__typename?: 'Mutation';
vote?: Maybe<{ __typename?: 'Entry'; score: number; id: number; vote: { __typename?: 'Vote'; vote_value: number } }>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type WithTypename<T extends { __typename?: any }> = { [K in Exclude<keyof T, '__typename'>]?: T[K] } & {
__typename: NonNullable<T['__typename']>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type GraphCacheKeysConfig = {
Comment?: (data: WithTypename<Comment>) => null | string;
Entry?: (data: WithTypename<Entry>) => null | string;
Repository?: (data: WithTypename<Repository>) => null | string;
User?: (data: WithTypename<User>) => null | string;
Vote?: (data: WithTypename<Vote>) => null | string;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type GraphCacheResolvers = {
Query?: {
feed?: GraphCacheResolver<WithTypename<Query>, QueryFeedArgs, Array<WithTypename<Entry> | string>>;
entry?: GraphCacheResolver<WithTypename<Query>, QueryEntryArgs, WithTypename<Entry> | string>;
currentUser?: GraphCacheResolver<WithTypename<Query>, Record<string, never>, WithTypename<User> | string>;
};
Comment?: {
id?: GraphCacheResolver<WithTypename<Comment>, Record<string, never>, Scalars['Int'] | string>;
postedBy?: GraphCacheResolver<WithTypename<Comment>, Record<string, never>, WithTypename<User> | string>;
createdAt?: GraphCacheResolver<WithTypename<Comment>, Record<string, never>, Scalars['Float'] | string>;
content?: GraphCacheResolver<WithTypename<Comment>, Record<string, never>, Scalars['String'] | string>;
repoName?: GraphCacheResolver<WithTypename<Comment>, Record<string, never>, Scalars['String'] | string>;
};
Entry?: {
repository?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, WithTypename<Repository> | string>;
postedBy?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, WithTypename<User> | string>;
createdAt?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, Scalars['Float'] | string>;
score?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, Scalars['Int'] | string>;
hotScore?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, Scalars['Float'] | string>;
comments?: GraphCacheResolver<WithTypename<Entry>, EntryCommentsArgs, Array<WithTypename<Comment> | string>>;
commentCount?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, Scalars['Int'] | string>;
id?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, Scalars['Int'] | string>;
vote?: GraphCacheResolver<WithTypename<Entry>, Record<string, never>, WithTypename<Vote> | string>;
};
Repository?: {
name?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['String'] | string>;
full_name?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['String'] | string>;
description?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['String'] | string>;
html_url?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['String'] | string>;
stargazers_count?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['Int'] | string>;
open_issues_count?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, Scalars['Int'] | string>;
owner?: GraphCacheResolver<WithTypename<Repository>, Record<string, never>, WithTypename<User> | string>;
};
User?: {
login?: GraphCacheResolver<WithTypename<User>, Record<string, never>, Scalars['String'] | string>;
avatar_url?: GraphCacheResolver<WithTypename<User>, Record<string, never>, Scalars['String'] | string>;
html_url?: GraphCacheResolver<WithTypename<User>, Record<string, never>, Scalars['String'] | string>;
};
Vote?: {
vote_value?: GraphCacheResolver<WithTypename<Vote>, Record<string, never>, Scalars['Int'] | string>;
};
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type GraphCacheOptimisticUpdaters = {
submitRepository?: GraphCacheOptimisticMutationResolver<MutationSubmitRepositoryArgs, Maybe<WithTypename<Entry>>>;
vote?: GraphCacheOptimisticMutationResolver<MutationVoteArgs, Maybe<WithTypename<Entry>>>;
submitComment?: GraphCacheOptimisticMutationResolver<MutationSubmitCommentArgs, Maybe<WithTypename<Comment>>>;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type GraphCacheUpdaters = {
Mutation?: {
submitRepository?: GraphCacheUpdateResolver<
{ submitRepository: Maybe<WithTypename<Entry>> },
MutationSubmitRepositoryArgs
>;
vote?: GraphCacheUpdateResolver<{ vote: Maybe<WithTypename<Entry>> }, MutationVoteArgs>;
submitComment?: GraphCacheUpdateResolver<
{ submitComment: Maybe<WithTypename<Comment>> },
MutationSubmitCommentArgs
>;
};
Subscription?: {
commentAdded?: GraphCacheUpdateResolver<
{ commentAdded: Maybe<WithTypename<Comment>> },
SubscriptionCommentAddedArgs
>;
};
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
TypeAliasDeclaration
|
export type GraphCacheConfig = {
schema?: IntrospectionData;
updates?: GraphCacheUpdaters;
keys?: GraphCacheKeysConfig;
optimistic?: GraphCacheOptimisticUpdaters;
resolvers?: GraphCacheResolvers;
storage?: GraphCacheStorageAdapter;
};
|
PabloSzx/graphql-code-generator
|
dev-test/githunt/types.urql.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const tempStyleCode = `.test-demo-logo {
height: 32px;
margin: 16px;
background: rgba(255, 255, 255, 0.2);
}
.test-demo-site-layout .test-demo-site-layout-background {
background: #fff;
}`;
return (
<>
<style dangerouslySetInnerHTML={{ __html: tempStyleCode }}
|
foxpage/foxpage-component-antd
|
packages/antd-layout/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const props = mountEditor(Editor, {
attrs: {
hasSider: true,
},
});
return (
<AntdLayout {...props}>
<TestContent />
</AntdLayout>
);
}
|
foxpage/foxpage-component-antd
|
packages/antd-layout/stories/index.stories.tsx
|
TypeScript
|
FunctionDeclaration
|
/**
* Top Root Level Wallet State to control what screen to show
*/
export function RootNavigator (): JSX.Element {
const {
wallets,
isLoaded
} = useWalletPersistenceContext()
// To prevent flicker on start of app, while API is not yet called
if (!isLoaded) {
return <></>
}
if (wallets.length === 0) {
return <WalletNavigator />
}
return (
<WalletNodeProvider data={wallets[0]}>
<WalletContextProvider api={WalletAddressIndexPersistence}>
<PrivacyLock />
<BottomSheetModalProvider>
<TransactionAuthorization />
<AppNavigator />
</BottomSheetModalProvider>
</WalletContextProvider>
</WalletNodeProvider>
)
}
|
AndiyNW/andiynwios
|
mobile-app/app/screens/RootNavigator.tsx
|
TypeScript
|
ArrowFunction
|
() => {
const component = create(<Emg src={ExampleImg} />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
}
|
wayou/emg
|
__tests__/emg.test.tsx
|
TypeScript
|
ArrowFunction
|
(value): string => _.get(value, 'requests.storage')
|
JPinkney/console
|
frontend/packages/kubevirt-plugin/src/selectors/selectors.ts
|
TypeScript
|
ArrowFunction
|
(vmLikeEntity: VMLikeEntityKind): boolean =>
vmLikeEntity && vmLikeEntity.kind === VirtualMachineModel.kind
|
JPinkney/console
|
frontend/packages/kubevirt-plugin/src/selectors/selectors.ts
|
TypeScript
|
ArrowFunction
|
(vmLikeEntity: VMLikeEntityKind): VMKind => {
if (!vmLikeEntity) {
return null;
}
if (isVm(vmLikeEntity)) {
return vmLikeEntity as VMKind;
}
return selectVm(vmLikeEntity as TemplateKind);
}
|
JPinkney/console
|
frontend/packages/kubevirt-plugin/src/selectors/selectors.ts
|
TypeScript
|
ArrowFunction
|
() => {
getSubById(this.sub)
.then(({ data, statusCode }) => {
if (statusCode === STATUS_SUCCESS) {
this.setState({
subData: data as ISubData
});
} else {
this.props.history.push(RouteNames.notFound);
}
})
.catch(() => this.props.history.push(RouteNames.notFound));
getSubPosts(this.sub, this.state.offset, this.limit).then(
({ data, statusCode }) => {
if (statusCode === STATUS_SUCCESS) {
this.setState(
{
posts: data as Array<IPost>,
hasFetched: true
},
() => {
if (data?.length < this.limit) {
this.setState({ hasMoreToFetch: false });
}
}
);
}
}
);
}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
({ data, statusCode }) => {
if (statusCode === STATUS_SUCCESS) {
this.setState({
subData: data as ISubData
});
} else {
this.props.history.push(RouteNames.notFound);
}
}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
() => this.props.history.push(RouteNames.notFound)
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
({ data, statusCode }) => {
if (statusCode === STATUS_SUCCESS) {
this.setState(
{
posts: data as Array<IPost>,
hasFetched: true
},
() => {
if (data?.length < this.limit) {
this.setState({ hasMoreToFetch: false });
}
}
);
}
}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
() => {
if (data?.length < this.limit) {
this.setState({ hasMoreToFetch: false });
}
}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
() => {
if (this.state.hasMoreToFetch) {
getSubPosts(this.sub, this.state.offset + this.limit).then(
({ data, statusCode }) => {
if (statusCode === STATUS_SUCCESS) {
this.setState(
(state) => ({
posts: [...state.posts, ...data],
offset: state.offset + this.limit
}),
() => {
if (data?.length < this.limit) {
this.setState((state) => ({ hasMoreToFetch: false }));
}
}
);
}
}
);
}
}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
({ data, statusCode }) => {
if (statusCode === STATUS_SUCCESS) {
this.setState(
(state) => ({
posts: [...state.posts, ...data],
offset: state.offset + this.limit
}),
() => {
if (data?.length < this.limit) {
this.setState((state) => ({ hasMoreToFetch: false }));
}
}
);
}
}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
(state) => ({
posts: [...state.posts, ...data],
offset: state.offset + this.limit
})
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
() => {
if (data?.length < this.limit) {
this.setState((state) => ({ hasMoreToFetch: false }));
}
}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
(state) => ({ hasMoreToFetch: false })
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
() => {
if (this.props.isAuthenticated) {
this.props.joinSub(this.sub);
} else {
this.props.history.push({
pathname: RouteNames.login,
state: { heading: "Login to join subreaddits you like!" }
});
}
}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
() => {
this.props.leaveSub(this.sub);
}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
(item, index) => (
<PostCard
{...item}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ArrowFunction
|
(_, index) => (
<PostSkeleton key={index} />
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
ClassDeclaration
|
class Subreaddit extends Component<IProps, IState> {
limit: number;
sub: string;
constructor(props: IProps) {
super(props);
this.limit = 15;
this.sub = this.props.match?.params?.id || "";
this.state = {
offset: 0,
posts: [],
hasMoreToFetch: true,
hasFetched: false,
subData: null
};
}
componentDidMount() {
document.title = getTabTitle(`b/${this.sub}`);
this.fetchAll();
}
componentWillUnmount() {
document.title = DEFAULT_TITLE;
}
fetchAll = () => {
getSubById(this.sub)
.then(({ data, statusCode }) => {
if (statusCode === STATUS_SUCCESS) {
this.setState({
subData: data as ISubData
});
} else {
this.props.history.push(RouteNames.notFound);
}
})
.catch(() => this.props.history.push(RouteNames.notFound));
getSubPosts(this.sub, this.state.offset, this.limit).then(
({ data, statusCode }) => {
if (statusCode === STATUS_SUCCESS) {
this.setState(
{
posts: data as Array<IPost>,
hasFetched: true
},
() => {
if (data?.length < this.limit) {
this.setState({ hasMoreToFetch: false });
}
}
);
}
}
);
};
fetchMore = () => {
if (this.state.hasMoreToFetch) {
getSubPosts(this.sub, this.state.offset + this.limit).then(
({ data, statusCode }) => {
if (statusCode === STATUS_SUCCESS) {
this.setState(
(state) => ({
posts: [...state.posts, ...data],
offset: state.offset + this.limit
}),
() => {
if (data?.length < this.limit) {
this.setState((state) => ({ hasMoreToFetch: false }));
}
}
);
}
}
);
}
};
joinSub = () => {
if (this.props.isAuthenticated) {
this.props.joinSub(this.sub);
} else {
this.props.history.push({
pathname: RouteNames.login,
state: { heading: "Login to join subreaddits you like!" }
});
}
};
leaveSub = () => {
this.props.leaveSub(this.sub);
};
render() {
const { posts, hasFetched, subData } = this.state;
const { classes, user } = this.props;
const isUserMember = user?.JoinedSubs.includes(this.sub);
const isUserOwner = subData?.Owner === user?.UserName;
return (
<PaginationContainer handlePagination={this.fetchMore}>
<Paper
className={classes.bannerContainer}
style={{ position: "relative" }}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface SelfProps {
match: {
params: {
[x: string]: string;
};
};
history: any;
}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface IState {
offset: number;
posts: Array<IPost>;
hasMoreToFetch: boolean;
hasFetched: boolean;
subData: ISubData | null;
}
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
TypeAliasDeclaration
|
type IProps = SelfProps & IClass & ReduxProps & { width: string };
|
Pradeep-selva/breaddit
|
client/src/Pages/Subreaddit/container.tsx
|
TypeScript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.